We derive from first principles the mechanical pressure $P$, defined as the force per unit area on a bounding wall, in a system of spherical, overdamped, active Brownian particles at density $rho$. Our exact result relates $P$, in closed form, to bulk correlators and shows that (i) $P(rho)$ is a state function, independent of the particle-wall interaction; (ii) interactions contribute two terms to $P$, one encoding the slow-down that drives motility-induced phase separation, and the other a direct contribution well known for passive systems; (iii) $P(rho)$ is equal in coexisting phases. We discuss the consequences of these results for the motility-induced phase separation of active Brownian particles, and show that the densities at coexistence do not satisfy a Maxwell construction on $P$.