ISLAMABAD, Pakistan (AP) — Pakistan’s energy minister on Tuesday blamed a lack of investment in the grid for its worst power outage in months, saying the aid-dependent nation had «learned lessons» from the outage it left behind. millions of people without electricity.

Like much of the national infrastructure, the power grid is in desperate need of an upgrade, but funding has been patchy as Pakistan reeled from one International Monetary Fund bailout to the next. The outage, which began Monday morning, was the second major failure since October.

“We learned lessons from yesterday that we need to invest in the distribution system,” Energy Minister Khurram Dastgir told reporters, announcing that power had been fully restored to the nation of nearly 220 million people.

“There hasn’t been any investment in improving these systems since the previous government,” he added.

The International Monetary Fund has bailed out Pakistan five times in the past two decades. However, its last tranche of bailout is on hold due to differences with the government over a review of the program that should have been completed in November.

Pakistan has enough installed power capacity to meet demand, but the sector is so indebted that it cannot afford to invest in infrastructure and power lines. Analysts say transmission and distribution are the weakest links.

China has invested in its energy sector as part of a $60 billion infrastructure plan that feeds into its «Belt and Road» initiative, but the details of this investment are unclear.

Dastgir said the cause of the outage was not yet known, but the ministry was conducting a security audit of the entire network. “The government plans to add more power distribution lines within the next 36 months,” he added.

Millions of Pakistanis experience partial blackouts on an almost daily basis, including scheduled «load shedding» power outages aimed at conserving electricity.

Many take these disruptions in stride, investing in generators and solar panels to generate their own power, but the fragile infrastructure also takes its toll.

“Without electricity, we can’t do anything,” said Sara Khan, headmistress of a girls’ school in Jacobabad, a southern city that regularly spends up to 18 hours a day without electricity. “People are facing too many hardships because of power outages.”