A general view shows the city of Zahle during Lebanon's Bekaa municipal elections, May 8, 2016. (Aziz Taher/Reuters)

Something remarkable is happening in this Lebanese farming town. Roads are no longer dark at night, and water is pumped to homes without interruption.

There’s electricity here in Zahle, 24 hours a day, seven days a week.

And if you don’t think that’s a big deal, ask residents of just about any other town in this tiny country. They endure daily outages that can last 18 hours, so they pay exorbitant fees to opportunistic owners of private electricity generators to get enough power.

In fact, millions of people across the Middle East are dealing with worsening power cuts. The issue fed the frustrations behind the Arab Spring revolts of 2011 and presents a daunting challenge for the region’s growing populations, including in war-torn countries such as Yemen and Iraq.

But in Zahle, a town of about 150,000 in Lebanon’s scenic Bekaa Valley, residents overcame energy woes with political will and creativity, offering the rest of the region possible lessons on how to obtain reliable and affordable electricity.

Assaad Nakad is the chairman of a local power company in Lebanon that provides round-the-clock electricity. He’s touring a power plant that he recently had built for his home town of Zahle, Lebanon on Aug. 15, 2016. (Hugh Naylor/The Washington Post)

“What’s happened in Zahle and its environs is a huge achievement, and it gives hope that our experience with 24-hour electricity could be replicated far beyond,” said Elie Marouni, a member of parliament from the town.

Last year, officials at Zahle’s power company braved death threats from the town’s generator owners (referred to by residents as “the Mafia”) as they built a power plant that services the town and surrounding municipalities.

Most residents backed construction of the area’s sole power plant, which cut the generator operators out of the market and nearly halved monthly energy bills.

“It’s a miracle!” said Elias Akiki, a 75-year-old owner of a souvenir shop in Zahle. “We were suffocating before all this.”

Lebanon’s power cuts started during the civil-war years, from 1975 to 1990. And they still bedevil most of the 4 million citizens of this Mediterranean country.

Lights and televisions still abruptly shut off multiple times a day. In some areas, the outages prevent municipalities from pumping water to homes and businesses.

Sami Saqer tours his fields of potatoes, wheat and crops that he farms in Zahle, Lebanon. (Hugh Naylor/The Washington Post)

Backup generators offer only limited amounts of energy. When they kick in, people can use an appliance or two at their homes and businesses, but any more risks overloading the circuits.

“It’s a long-standing crisis here, and it is only getting worse,” said Jihan Seoud, a Lebanon-based energy and environment expert at the U.N. Development Program.

The reasons for Lebanon’s outages are complex.

More than a million Syrians fled their civil war for refuge here, badly straining electricity supplies.

The Lebanese tend to blame their dysfunctional government. Squabbling politicians have failed to agree on a new president for more than two years, leaving the key post vacant during that time. They have struggled with even seemingly minor things such as trash collection in Beirut, the capital. And the quarreling partly explains why no new power plants have been built since the 1990s, apart from Zahle’s, and why existing facilities produce just over half of the electricity the country needs.

Corruption plays a major role, said Marwan Iskander, a Lebanese economist. Patronage from powerful figures has allowed many subscribers to the national electricity network to get away with not paying their bills.

“I even know one former parliamentarian who literally owes millions of dollars in unpaid electricity bills,” Iskander said.

The outages in Zahle worsened in recent years, sometimes lasting an entire day.

The town’s old power plant was destroyed during the civil war. So the local power company, Electricité de Zahlé (EDZ), contracted a British firm to build and help operate a 60-megawatt plant, which went online in March 2015.

Until then, EDZ had only acted as a distributor of electricity, which it received from the state power firm.

“I got tired — we all got tired — of promises by the government that there would be 24/7 electricity. It just never happened, so we decided to act,” said EDZ’s chief executive, Assaad Nakad.

Government officials pressured Nakad to stop the project, but he said he fought them off by invoking a law from the 1920s that gives EDZ the right to generate and distribute its own electricity.

Officials from the electricity ministry and state power firm did not respond to questions by phone and text message about the issue.

Nakad’s family received anonymous death threats during the plant’s construction, and unidentified assailants shot several of EDZ’s transformers. A group of men who supplied the town’s private generators with fuel stormed into his office with an ultimatum, Nakad said.

“They said they’d kill me if I built the plant,” he said. “These men had a lot to lose.”

The town’s mayor, Assaad Zougheib, said the three dozen or so generator owners would regularly dismiss requests to lower their fees. And some of them became extravagantly wealthy, residents said.

“My uncle owned several generators,” said Charbel Boieny, who runs a candy shop in Zahle. “He owns six villas.”

Around the time of the plant’s construction, residents said they faced intimidation from the generator owners. One sent cronies to the home of Wassim Teenny and told him that he couldn’t unhook from the neighborhood generator.

“They also demanded that we give them extra money, but everyone in the neighborhood refused to do what they told us,” said Teenny, 27, who works at a paint company.

Fast forward to the present day, and Zahle’s new power plant is supplying constant electricity to an estimated 250,000 people in the area. And Sami Saqer, 52, a farmer, is pocketing thousands of dollars that he used to spend on generator costs to pump groundwater for his fields of potatoes, wheat and squash.

“I can even farm at night if I want,” he said, pointing to street lamps near his crops.

Even generator operators like George al-Youssef, who is now out of work, acknowledge that Zahle is better off. Youssef, 66, complained that electricity prices in the town are still high relative to other countries.

But, he said, “The prices are lower than before.”

Read more:

Suzan Haidamous contributed to this report.