In this paper, we identify a space-dependent source for a fractional diffusion equation. This problem is ill-posed, i.e., the solution (if it exists) does not depend continuously on the data. The generalized Tikhonov regularization method is proposed to solve this problem. An a priori error estimate between the exact solution and its regularized approximation is obtained. Moreover, an a posteriori parameter choice rule is proposed and a stable error estimate is also obtained, Numerical examples are presented to illustrate the validity and effectiveness of this method.