This paper presents a two-level hierarchical control method for the power distribution between the hybrid energy storage system (HESS) and the main dc bus of a microgrid for ultrafast charging of electric vehicles (EVs). The HESS is composed of a supercapacitor and a battery and is an essential part to fulfill the charging demand of EVs in a microgrid made up of a 220 VRMS ac bus, two dc buses of 600 V and 1500 V, respectively, and four charging points. A state machine defines the four operating modes of the HESS and establishes the conditions for the corresponding transitions among them, namely, charging the battery and the supercapacitor from the bus, injecting the current from the HESS into the 1500 V dc bus to ensure the power balance in the microgrid, regulating the bus voltage, and establishing the disconnection mode. The primary level of the control system regulates the current and voltage of the battery, supercapacitor, and dc bus, while the secondary level establishes the operating mode of the HESS and provides the appropriate references to the primary level. In the primary level, sliding mode control (SMC) is used in both the battery and supercapacitor in the inner loop of a cascade control that implements the standard constant current–constant voltage (CC-CV) charging protocol. In the same level, linear control is applied in the CV phase of the protocol and for bus voltage regulation or the current injection into the bus. PSIM simulations of the operating modes and their corresponding transitions verify the theoretical predictions.