For pulsed power load (PPL) accommodation in a medium‐voltage DC (MVDC) shipboard power system (SPS), the charging control of energy storage systems (ESSs) and the generation control of distributed generators (DGs) need to be properly coordinated. Targeting the important but not well‐studied problem, an optimal output‐constrained control algorithm for the offline PPL accommodation strategy is presented. Three control objectives including realising the generation and charging control references, maintaining the DC bus and supercapacitor voltages within the safe operating ranges, and minimising the total generation cost of DGs, are fulfilled concurrently. First, an SPS model with multiple DGs, a supercapacitor ESS, and regular loads is developed. By restricting the DC bus and supercapacitor voltages within pre‐defined constraints, both the transient‐ and steady‐state performances of the SPS are guaranteed. Furthermore, by incorporating the cost minimisation objective into designed virtual control signals, the third control objective on energy efficiency is realised. The stability of the presented algorithm is rigorously proven based on the Lyapunov method. Finally, detailed case studies are conducted to validate the performance of the designed algorithm.