Fiscal challenges pervade the electricity sector in many developing countries. Low bill payment and high theft mean utility customers have little incentive to conserve. It also means electricity distribution companies have less to invest in infrastructure maintenance, modernization, and technical upgrades. The resulting low quality electricity services can impair economic benefits from connections to the electrical grid. Using differences in intervention timing across space, we study the impacts of an infrastructural intervention that made illegal electricity connections physically more difficult in Karachi, Pakistan. We find that this infrastructure improvement reduced non-technical losses, increased revenue recovery, and led to lower electricity delivered to the distribution system, a proxy for generation. This translates into a reduction in CO$_2$ emissions that is between 0.10% to 1.19% of Pakistan’s emissions within a year. Losses fall due to an increase in formal utility customers and greater billed consumption among the existing formal customers. Consumers report fewer service outages, as well as greater appliance ownership and use after the infrastructure upgrade. The improvement in infrastructure also provided the utility with some technical resilience to the disruptions caused by the COVID-19 pandemic, protecting against an uptick in non-technical losses.