In this paper, we study optimal control problems of semilinear elliptic and parabolic equations. A tracking cost functional, quadratic in the control and state variables, is considered. No control constraints are imposed. We prove that the corresponding state equations are well-posed for controls in L 2 . However, it is well-known that in the L 2 framework the mappings involved in the control problem are not Frechet differentiable in general, which makes any analysis of the optimality conditions challenging. Nevertheless, we prove that every L 2 optimal control belongs to L ∞ , and consequently standard optimality conditions are available.