In this paper we study optimal control problems governed by a semilinear elliptic equation. The equation is nonmonotone due to the presence of a convection term, despite the monotonocity of the nonlinear term. The resulting operator is neither monotone nor coervive. However, by using conveniently a comparison principle we prove existence and uniqueness of solution for the state equation. In addition, we prove some regularity of the solution and differentiability of the relation control-to-state. This allows us to derive first and second order conditions for local optimality.