In this paper, an inverse source problem for the time-fractional diffusion equation is investigated. We prove a conditional stability for this problem. A truncation method is presented to deal with the ill-posedness of the problem and error estimates are obtained with an a priori strategy and an a posteriori choice rule to find the regularization parameter. Numerical examples show that the proposed method is effective and stable. (C) 2012 Elsevier Inc. All rights reserved.