In this paper we consider a second order nonlinear differential equation with maximal monotone terms and nonlinear, possibly multivalued boundary conditions. Using the theory of maximal monotone operators and the Leray—Schauder alternative theorem we establish the existence of solutions. Our formulation is very general and includes as special cases the Dirichlet, Neumann and periodic problems.