In this paper we investigate the rigidity of ancient solutions of the mean curvature flow with arbitrary codimension in space forms. We first prove that under certain sharp asymptotic pointwise curvature pinching condition the ancient solution in a sphere is either a shrinking spherical cap or a totally geodesic sphere. Then we show that under certain pointwise curvature pinching condition the ancient solution in a hyperbolic space is a family of shrinking spheres. We also obtain a rigidity result for ancient solutions in a nonnegatively curved space form under an asymptotic integral curvature pinching condition. n−2 2(n−1) |H| 4 + 4(n − 1)c|H| 2 . It is easy to check that α(n, |H|, c) is strictly bigger 2010 Mathematics Subject Classification. 53C44, 53C40.