We consider a parabolic equation with a singular potential: ∂ t u − div ( p ( x ) ∇ u ) − µ | x | 2 u = f ( x ) R ( x , t ) , ( x , t ) ∈ Ω × ( 0 , T ) , where Ω is a bounded domain in R n . The main result is a Lipschitz stability estimate for an inverse source problem of determining a spatial varying factor f( x) of the source term R( x,t) f( x) . We obtain a consistently stability result for any µ ≤ p 1 µ ∗ , where p 1 > 0 is the lower bound of p( x) and µ ∗ = ( n − 2 ) 2 / 4 , and this condition for µ is also almost an consistently optimal condition for the existence of solutions. The method we used is based on a improved Carleman estimate, which is the key to derive the consistent result for the choose of parameter µ. In fact, a more general case { a ij ( x ) } 1 ≤ i , j ≤ n instead of p( x) in the principal part could be solved with a similarly idea. MSC 35K05; 35K67; 35Q40; 35N30; 35A23.