The increasing use of renewable energies places new challenges on the balance of the electricity system between demand and supply, due to the intermittent nature of renewable energy resources. However, through frequency regulation (FR) services, owners of battery storage systems can become an essential part of the future smart grids. We propose a thorough first study on the use of batteries associated with base stations (BSs) of a cellular network, to participate in ancillary services with respect to FR services, via an auction system. Trade-offs must be made among the number of participating BSs, the degradation of their batteries and the revenues generated by FR participation. We propose a large-scale mathematical programming model to identify the best participation periods from the perspective of a cellular network operator. The objective is to maximize profit while considering the aging of the batteries following their usage to stabilize the electrical grid. Experiments are conducted with data sets from different real data sources. They not only demonstrate the effectiveness of the optimization model in terms of the selection of BSs participating in ancillary services and providing extra revenues to cellular network operators, but also show the feasibility of ancillary services being provided to cellular network operators.