In this paper an algorithm for optimal charging of a valve-regulated lead-acid (VRLA) battery stack based on model predictive control (MPC) is proposed. The main objective of the proposed algorithm is to charge the battery stack as fast as possible without violating the constraints on the charge current, the battery voltage and the battery temperature. In addition, a constraint on the maximum allowed voltage of every battery in the battery stack is added in order to minimize degradation of the individual batteries during charging. The convexity of the VRLA battery charging optimization problem is proven, which makes the control algorithm suitable for efficient on-line implementation via solving a quadratically constrained quadratic program (QCQP). The recursive feasibility and stability of the proposed control strategy is ensured. The proposed algorithm is validated both through simulation tests and on the experimental setup.