We study the equation (1) u'(t) = Au(t) + f(t), T > o, u(O) = u(o), in a Banach space X with A the generator of an analytic (or a strongly continuous) semigroup S(.) and prove that if solutions of (1) are bounded and ultimate bounded with f T-periodic and S(T) compact, then (1) has a T-periodic solution. We also show that the existence of a proper Liapunov function implies the boundedness and ultimate boundedness of solutions of (1). These results extend earlier results in finite dimensional spaces. We then apply the results to a parabolic partial differential equation (2) u(t)(t,x) = Sigma/\alpha\less than or equal to 2m C-alpha(x)D(alpha)u(t,x) + f(t,x).