We consider an optimal control problem constrained by a parabolic partial differential equation with Robin boundary conditions. We use a space–time variational formulation in Lebesgue–Bochner spaces yielding a boundedly invertible solution operator. The abstract formulation of the optimal control problem yields the Lagrange function and Karush–Kuhn–Tucker conditions in a natural manner. This results in space–time variational formulations of the adjoint and gradient equation in Lebesgue–Bochner spaces, which are proven to be boundedly invertible. Necessary and sufficient optimality conditions are formulated and the optimality system is shown to be boundedly invertible. Next, we introduce a conforming uniformly stable simultaneous space–time (tensorproduct) discretization of the optimality system in these Lebesgue–Bochner spaces. Using finite elements of appropriate orders in space and time for trial and test spaces, this setting is known to be equivalent to a Crank–Nicolson time-stepping scheme for parabolic problems. Comparisons with existing methods are detailed. We show numerical comparisons with time-stepping methods. The space–time method shows good stability properties and requires fewer degrees of freedom in time to reach the same accuracy.