A significant number of 5G base stations (gNBs) and their backup energy storage systems (BESSs) are redundantly configured, possessing surplus capacity during non-peak traffic hours. Moreover, traffic load profiles exhibit spatial. A significant number of 5G base stations (gNBs) and their backup energy storage systems (BESSs) are redundantly configured, possessing surplus capacity during non-peak traffic hours. Moreover, traffic load profiles exhibit spatial variations across different areas. Proper scheduling of surplus capacity from gNBs and BESSs in different areas can provide sustainable frequency support for the power system without compromising the operation of 5G network. In this paper, a comprehensive strategy is proposed to safely incorporate gNBs and their BESSs (called “gNB systems”) into the secondary frequency control procedure. Initially, an aggregated model is developed using a state space method to capture the state of a cluster of heterogeneous gNB systems (gNBs-cluster). Subsequently, a utility function i. ••Joint control architecture integrates gNB systems into power system control.••Aggregated model captures state of heterogeneous gNBs-cluster efficiently.••Utility function scores gNBs-cluster state in a normalized manner.••Broadcast-based aggregated control reduces communication needs.••5G base stationBackup energy storage systemSecondary frequency controlDemand response1.1. BackgroundThe increasing penetration of renewable energy sources, characterized by variable and uncertain production patterns, has created an urgent need for enhanced flexibility in the frequency control of power systems. In parallel, the deployment of 5th-generation mobile network (5G) infrastructures has rapidly expanded in recent years. The limited penetration capability of millimeter waves necessitates the deployment of significantly more 5G base stations (the next generation Node B, gNB) than their 4G counterparts to ensure network coverage. Notably, the power consumption of a gNB is very high, up to 3–4 times of the power consumption of a 4G base stations (BSs). The substantial quantity, rapid growth rate, and high ener. The proposed framework, depicted in Fig. 1, comprises of two interconnected planes: the 5G mobile network plane and the power system plane, which are energetically linked by power feeders (red line). The 5G network plane consists of three layers: 5G-CN, 5G-TN, and 5G-RAN. The servers in 5G-CN operate as a centralized controller while 5G-TN is responsible for the bi-directional transmission of information. In 5G-RAN, the gNB systems within designated areas are combined into gNBs-clusters by aggregators. All gNBs-clusters are powered by the power system plane through power feeders, so switching the modes of a certain number of gNBs (sleep/active) and BESSs (charge/idle/discharge) can alter the power injection of the power system. Therefore, it is feasible to establish a demand-side ma.