We study the distribution of first-passage functionals of the type A = t f 0 x n (t) dt where x(t) represents a Brownian motion (with or without drift) with diffusion constant D, starting at x0 > 0, and t f is the first-passage time to the origin. In the driftless case, we compute exactly, for all n > −2, the probability density Pn(A|x0) = Prob.(A = A). We show that Pn(A|x0) has an essential singular tail as A → 0 and a power-law tail ∼ A −(n+3)/(n+2) as A → ∞. The leading essential singular behavior for small A can be obtained using the optimal fluctuation method (OFM), which also predicts the optimal paths of the conditioned process in this limit. For the case with a drift toward the origin, where no exact solution is known for general n > −1, we show that the OFM successfully predicts the tails of the distribution. For A → 0 it predicts the same essential singular tail as in the driftless case. For A → ∞ it predicts a stretched exponential tail − ln Pn(A|x0) ∼ A 1/(n+1) for all n > 0. In the limit of large Péclet number Pe = µx0/(2D), where µ is the drift velocity toward the origin, the OFM predicts an exact large-deviation scaling behavior, valid for all A: − ln Pn(A|x0) Pe Φn z = A/Ā , whereĀ = x n+1