The homotopy analysis method (HAM) is applied to solve linear and nonlinear fractional partial differential equations (fPDEs). The fractional derivatives are described by Caputo's sense. Series solutions of the fPDEs are obtained. A convergence theorem for the series solution is also given. The test examples, which include a variable coefficient, inhomogeneous and hyperbolic-type equations, demonstrate the capability of HAM for nonlinear fPDEs.