Men wait in line to get fuel for their motorbikes Monday at a gas station in Rawalpindi. Pakistan's government is facing public anger over severe gasoline shortages. (Faisal Mahmood/Reuters)

As much of the world enjoys the lowest fuel prices in years, Pakistan has been hit with a gasoline shortage that has residents enraged at what they see as government incompetence.

For more than a week, motorists across Pakistan have been scrambling to find even a few squirts of gasoline as the pumps in several major cities have dried up. The shortage has upended daily life here while exposing the nuclear-armed country’s vulnerability to public disorder and political upheaval.

Over the weekend, in what officials say is the country’s worst fuel shortage in memory, an estimated 95 percent of gas stations in Pakistan’s second-largest city, Lahore, ran out of gas. The shortage was so severe it prompted a partial suspension of ambulance service, and motorists scuffled with each other at the few pumps that remained open.

Tuesday brought some relief to Lahore as well as to Islamabad — where rationing forced motorists to wait hours for up to $10 in gas — as officials found enough fuel to avoid a complete collapse of the transportation network. But shortages appeared to be worsening in Pakistan’s largest city, Karachi.

“Pray for Pakistan, because I don’t have any hope,” Muhammad Rafiq, 55, said as he waited in line for more than two hours to fill up his van in Lahore, where three-quarters of the gas stations appeared to still be closed Tuesday.

With public anger building, Prime Minister Nawaz Sharif rushed back from Saudi Arabia to personally oversee resupply efforts.

But the crisis has shaken public confidence in Sharif’s government in yet another test of Pakistan’s fragile democracy.

Though the circumstances behind the shortage remain murky, it appears that Pakistan’s government simply underestimated how much gasoline it would take to power a country of about 180 million people.

Petroleum industry officials say there are 6 million gasoline-powered vehicles in Pakistan. Sharif and other government officials say the decline in fuel prices caused a spike in demand. Government finance experts and regulators were caught off guard, causing them to fall short in ordering enough stock through the publicly owned company Pakistan State Oil.

After arriving back in Islamabad, Sharif apologized to the nation and promised to immediately procure more gasoline.

But many economists say Pakistan’s energy crisis extends far beyond demand, and their confidence in the government’s ability to address the problems is being tested.

For years, Pakistan has subsidized energy costs for residents and state-owned enterprises, making it difficult for an equally impoverished government to make up the difference.

The circular debt, estimated at $2.5 billion, has made suppliers wary of keeping adequate stock, said Kaiser Bengali, an economist and adviser to Pakistan’s Baluchistan province.

“They don’t want to run at a loss, so I suspect it was a choice between their private interests and cutting down on reserves,” Bengali said.

The decline in fuel prices should have allowed Pakistan to overcome some of its debt to suppliers, which also leads to chronic shortages of electricity and cooking gas.

In a bid to manage the outrage, Pakistan’s petroleum minister announced Monday a reduction in prices at the pump.

Rashid Amjad, a professor at the Lahore School of Economics, said that will only exacerbate problems in the long term.

“We all thought falling oil prices would be an impetus to getting the economy back on track, but instead the government has fallen flat on its face in handling this,” Amjad said.

He and others said it could take a month for the supply to stabilize. And as it drags on, Sharif is experiencing an erosion in the goodwill he garnered in the aftermath of the Pakistan Taliban attack on an army-run school in Peshawar that killed about 150 people, mostly students.

Afrasiab Khattak, a senator with the Awami National Party, noted that most opposition parties also defended Sharif during protests last summer calling for his resignation.

But Khattak said it is becoming increasingly difficult for opposition leaders to support him.

“Pakistan is face-to-face with a most difficult war, and the stakes are very high,” Khattak said. “But how can a nation fight this war on terror when it doesn’t have fuel and can’t take timely decisions to resolve very common issues?”

In 2013, Sharif returned to office after an election in which Pakistan completed its first transfer of power from one democratically elected government to another. Sharif had served two terms as prime minister in the 1990s but was ousted in a military coup in 1999.

As they waited in line for gas in Lahore on Tuesday, many motorists said they are second-guessing Pakistan’s democracy.

“The army should impose martial law, and then we will get everything,” said Mohammad Idrees, who was trying to fill up his tank before returning to his job at a local printing press. “Public leaders have failed.”

But some Lahore residents are taking the shortage in stride.

When lawyer Ishtiaq Ahmad saw fights breaking out over gas Friday in Lahore, he instead went to a local market and spent $90 on a bicycle.

“I haven’t [ridden] a bicycle in 20 to 25 years,” the 40-year-old said Tuesday after completing a 10-mile ride from his home to the courthouse.

“And you know what? I enjoy it.”

Shaiq Hussain in Islamabad contributed to this report.