With the development of green energy technologies, base stations (BSs) can be powered by green energy in order to reduce the on-grid power consumption, and subsequently reduce the carbon footprints. As smart grid advances, power trading among distributed power generators and energy consumers will be enabled. In this paper, we have investigated the optimization of smart grid enabled mobile networks in which green energy is generated in individual BSs and can be shared among the BSs. In order to minimize the on-grid power consumption of this network, we have proposed to jointly optimize the BS operation and the power distribution. The joint BS operation and Power distribution Optimization (BPO) problem is challenging due to the complex coupling of the optimization of mobile networks and that of power grid. We have proposed an approximation solution that decomposes the BPO problem into two subproblems and solves the BPO by address these subproblems. The simulation results show that by jointly optimizing the BS operation and the power distribution, the network achieves about 18% on-grid power savings.