This paper addresses the problem of optimal predefined-time stability. Predefined-time stable systems are a class of fixed-time stable dynamical systems for which the minimum bound of the settling-time function can be defined a priori as an explicit parameter of the system. Sufficient conditions for a controller to solve the optimal predefined-time stabilization problem for a given nonlinear system are provided. These conditions involve a Lyapunov function that satisfies a certain differential inequality for guaranteeing predefined-time stability. It also satisfies the steady-state Hamilton–Jacobi–Bellman equation for ensuring optimality. Furthermore, for nonlinear affine systems and a certain class of performance index, a family of optimal predefined-time stabilizing controllers is derived. This class of controllers is applied to optimize the sliding manifold reaching phase in predefined time, considering both the unperturbed and perturbed cases. For the perturbed case, the idea of integral sliding mode control is jointly used to ensure robustness. Finally, as a study case, the predefined-time optimization of the sliding manifold reaching phase in a pendulum system is performed using the developed methods, and numerical simulations are carried out to show their behavior.