Then-senior rebel commander Khalifa Hifter leaves a press conference in Benghazi in March 2011. (Anja Niedringhaus/AP)

Two weeks before he masterminded an assault on two major Libyan cities, Khalifa Hifter hosted a dinner to court a potential ally. Hifter was normally a confident man, a former general who had gone on to spend years in Northern Virginia as an exiled opposition leader before returning home for the 2011 Libyan revolution.

But that night he seemed unsteady.

“Do you think I’m committing suicide?” Hifter asked his new friend and supporter, businessman Fathallah Bin Ali, as they dined in the eastern city of Benghazi.

Today, Hifter, 71, is leading what may be the most serious challenge to the Libyan government since the overthrow of Moammar Gaddafi in 2011. Attacks by Hifter’s forces on rival militias in Benghazi and Tripoli in recent days have left more than 70 people dead and dozens more injured. Militiamen loyal to him have overrun parliament.

Libya may now be sliding into civil war. On Monday, additional militias threw their weight behind Hifter, including those at an air force base in the far-eastern city of Tobruk, fighters who have occupied swaths of the country’s oil infrastructure, and members of an important Benghazi militia. Meanwhile, fighters from the powerful city-state of Misurata said they would soon move on Tripoli to counter Hifter’s assault.

Hifter had plotted his operation for months, friends say. His goal is to rid the country of the Islamist militias that he accuses of terrorizing the country, assassinating and kidnapping their political rivals, in the three years since they all fought on the same side to oust a dictator.

Libya’s weak central government has failed to form a unified army and police force from the scores of well-armed militias that emerged from the revolution. And it has failed to stop the murders and kidnappings that have plagued this oil-rich country. That has led to an explosive situation in the young democracy.

“At this point, people are desperate,” said Bilal Bettamer, a 24-year-old Benghazi resident who organized a mass demonstration against the Islamist militias in the city in 2012. He said he was willing to trust Hifter, “if he proves to be successful, and he proves that it’s not just for the personal glory.”

In recent months, Hifter has gathered allies in his stronghold of Beida, 125 miles east of Benghazi, from among a disenfranchised former officers corps. He also has held court with like-minded politicians and tribal leaders in Benghazi, his friends say.

In February he startled the country by going on television and declaring a plan to save the nation. Nothing happened. But Hifter was fed up with the lawlessness in Libya, Bin Ali said as he recalled their meeting.

“We have to stop it,” Hifter said, according to Bin Ali. Because the interim government and parliament were so ineffectual, “he decided to go for himself to try to fight for [his] rights,” the businessman said.

Switched sides in the 1980s

As a young army officer, Hifter took part in the coup that brought Gaddafi to power in 1969. But Hifter switched sides in the late 1980s, after he was captured while fighting for Gaddafi’s army in a war in neighboring Chad.

He became the leader of a rebel group called the Libyan National Army, which he claimed received U.S. assistance. He later sought refuge in the United States. He apparently became a U.S. citizen — he voted in Virginia in elections in 2008 and 2009, records show.

One member of a prominent Libyan opposition family who knew Hifter when both were living in Northern Virginia noted that he and his family were comfortable. Hifter resided in Falls Church until 2007 and later in a five-bedroom home in a quiet neighborhood in Vienna, near the golf course of the Westwood Country Club. He sold the second home in 2010 for $612,000, according to public records.

“They lived a very good life, and nobody knows what his source for compensation was,” said the acquaintance, who added that Hifter’s family was not originally wealthy.

(The former general spelled his name “Hifter” on legal documents in the United States. It has also been rendered in reports from Libya as “Haftar” and “Hiftar.”)

When Hifter returned to Libya in 2011, he was welcomed as a hero and leader in the country’s burgeoning rebel forces.

But some who knew him said he was arrogant and angled for power.

“He was like a little child. He was actually trying to become the chief of staff,” said Jallal Galal, a former spokesman for the rebels. After the rebels chose another former general, Abdul Fattah Younis, to lead them, Hifter was irate, Galal recalled.

Hifter’s reputation as a prominent opposition figure, his military training in the Soviet Union in the 1970s and his wartime experience in Chad quickly brought him support on Libya’s front lines.

But his decades-long absence from the country also earned him suspicion and rivals. Those early splits in the rebel ranks would form the foundation of today’s power struggle.

Hifter’s uprising began late last week, when forces loyal to him launched a wave of strikes against Islamist militias in Benghazi, setting off fierce battles. On Sunday, two other militias, claiming loyalty to Hifter, attacked the country’s General National Congress in the capital before declaring the institution formally dissolved.

“The battle continues until the elimination of terrorism,” Col. Wanis Bu Khameida, the leader of the pro-Hifter Benghazi militia, said in a televised news conference from the city.

On Monday, the head of Libya’s parliament called on his allied militias based in Misurata to come to the embattled legislature’s assistance. Militias in various parts of the country began to line up on either side, essentially pitting Islamist forces in Benghazi and their allies from Misurata against Gaddafi-era military officers. The latter group was backed by more-liberal politicians and tribal militias from Tripoli and the western mountains.

In one town in Libya’s Nafusa Mountains, two militias stated their support for opposing sides.

The head of Libya’s General National Congress, Nouri Abu Sahmein, called Hifter’s offensive an “attempt to wreck the path of democracy” and said he must be stopped, the Associated Press reported.

Lawmakers undecided

But leading politicians seemed divided about what to do. Members of the country’s weak interim cabinet held an emergency meeting Monday and issued a vague open letter to the legislature, suggesting that it vote yet again for a new prime minister — replacing one chosen this month — and eventually be dissolved.

Parliament was scheduled to convene Tuesday. If it does, it would present a significant test of Hifter’s power.

Some of Hifter’s allies still appeared undecided Monday on whether they would follow him into an all-out confrontation.

“I’m not sure of his goals. He doesn’t seem to have a clear vision of what he’s really doing,” said one lawmaker who is part of a political alliance that is closely tied to the militias that attacked the legislature Sunday. He asked that his name not be published for safety reasons.

Hauslohner reported from Moscow and Abdel Kouddous reported from Tripoli. Hassan Morajea in Tripoli, Erin Cunningham and Lara El Gibaly in Cairo, and Julie Tate and Victoria St. Martin in Washington contributed to this report.