Decarbonization of electricity generation together with electrification of energy-and-carbon-intensive services such as heating and cooling is needed to address ambitious climate goals. Here we show that city-scale electrification of heat with large-scale thermal storage also cost-effectively unlocks significant additional operational benefits for the power sector. We build an optimization model of fully electrified district heating and cooling networks integrated with other electric loads. We leverage real-world consumption and operational data from a first-of-a-kind facility that meets heating, cooling and electrical energy requirements equivalent to a city of 30 000 people. Using our model, we compute optimal operational strategies for the controllable loads and thermal storage in this system under different economic hypotheses. In our example, electrifying the previously gas-based heating and cooling infrastructure has led to a 65% reduction in the overall campus carbon footprint. Through least-cost scheduling, the load shape of the aggregate energy system can be flattened and annual peak power demand can be reduced by 15%. Through carbon-aware scheduling that takes advantage of variations in grid power carbon intensity, heating and cooling emissions could further decrease by over 40% in 2025 compared to the 2016 baseline, assuming a policy-compliant electricity mix for California. However, rethinking electricity rates based on peak power usage will be needed to make carbon-aware scheduling economically attractive.