Libya's future looked promising after its dictator was overthrown nearly three years ago.
But its recent history has been chaotic, with a succession of weak prime ministers at the mercy of militias more loyal to regions, ideologies and individuals rather than to a central government in Tripoli.
In recent days, however, a new would-be savior, Gen. Khalifa Hifter, has been gathering support from secular forces and, it appears, from the governments of Egypt and the United Arab Emirates.
On Wednesday, the United States ambassador to Libya, Deborah Jones, appeared to endorse Hifter, a defector from Moammar Gadhafi's army who spent 20 years in northern Virginia.
"I am not going to come out and condemn blanketly what he did," she told an audience at the Stimson Center in Washington.
Hifter's forces, who have battled militant Islamists in eastern Libya and stormed the parliament in Tripoli last weekend, are "going after very specific groups ... on our list of terrorists," Jones said.
Among the targets is Ansar al-Sharia, a group recently put on the U.S. State Department's terrorist list. It is believed responsible for the attack on the U.S. consulate in Benghazi in 2012 that killed Ambassador Chris Stevens and three other Americans.
But Hifter is also going after more moderate Islamists who dominate Libya's weak parliament, the General National Congress.
After its building was ransacked on Sunday, the congress -- attacked in another location when it tried to meet Tuesday -- has now agreed to dissolve and allow elections for a new body at the end of next month.
Hifter's anti-Islamic agenda fits with the views of Egypt's military-run government, which is about to anoint former army chief Abdel Fattah el-Sissi as president in barely contested elections next week.
The United Arab Emirates has also embraced a harsh crackdown on the Muslim Brotherhood.
Jones, asked if these two countries were behind Hifter, said, "I have nothing for you on that" but added that Libyan exiles in Egypt and the UAE "have expressed support" for Hifter.
The general, she added, has "already produced one thing many Libyans wanted" - a definite date for elections for a new parliament.
When the revolution against Gadhafi began in 2011, it put together an impressive group of exiles, the National Transitional Council. The council attracted support from the Arab League, NATO and eventually the U.N. Security Council to establish a no-fly zone protecting Libyans from Gadhafi's forces.
But after Gadhafi was defeated and assassinated by the rebels, the new government in Tripoli embraced what a recent Atlantic Council report calls a policy of "appeasement," which entailed paying off local militias rather than attempting to knit them together into a coherent national army.
The result has been a kaleidoscope of militant groups; some quarter-million armed men are on the government payroll.
Libya's cities and regions, never that well integrated, have gone off on their own tangents, with Islamists dominating in the east and more secular forces in the west. In the middle of the Mediterranean coast, the city of Misrata has its own administration and security forces. It has so far stayed out of Hifter's offensive, according to Karim Mezran, a North Africa expert at the Atlantic Council.
The country has been in such disarray that the head of a force created to provide security for Libya's oil exports seized oil ports and tried in March to export oil on a North Korean-flagged tanker.
U.S. Navy Seals forced the tanker back to Libya and a new UN Security Council resolution gives the U.S. and other naval powers authority to block any further attempts at stealing Libya's key source of revenue.
But oil exports, which had exceeded 1.5 million barrels a day before the revolution, now amount to barely 250,000 barrels a day.
Foreign companies that had seen post-Gadhafi Libya as a potential bonanza for investment - given the country's large hard currency reserves, oil wealth and unspoiled beaches - are steering clear until some semblance of order can be restored.
Is Hifter the one to accomplish this?
Mezran calls Hifter - who helped Gadhafi seize power in 1969 but then took part in a disastrous war in Chad in the 1980s - "an ambiguous character."
Hifter may have developed ties with the CIA a decade later when he plotted against Gadhafi from a comfortable exile in Virginia.
Unlike Algeria, which went through a revolution against France in the 1960s, "there is no Boumediene" in Libya, Mezran said, referring to Houari Boumediene, the leader of the Algerian revolution.
Libya's fragmentation, Mezran said, "has prevented one figure from emerging."
U.S. ambassador Jones said her impression from talking to Libyans since Hifter's latest offensive began is that many support Hifter's actions but there is "less [support] for him as an individual.
The jury is still out because it's not clear what the agenda behind this is."
Hifter's appearance on television on Wednesday in military uniform surrounded by other uniformed men suggested that he has in mind a larger role for himself.
He said he had asked Libyan judicial authorities to form a presidential council to rule until parliamentary elections scheduled for June 25.
Although he insisted that the new council would be "civilian" in nature, Libyans - and those outside who care about the fate of the country - have reason to be skeptical.
Given recent trends in the region, it is entirely possible that Hifter will try to follow Sissi's example.
However, as Jones pointed out on Wednesday, Sissi has a powerful national army behind him - something Libya is unlikely to acquire for many years to come.
Barbara Slavin is a senior fellow at the Atlantic Council's South Asia Center and a correspondent for Al-Monitor.com, a website specializing in the Middle East. She is the author of a 2007 book, Bitter Friends, Bosom Enemies: Iran, the US and the Twisted Path to Confrontation, and is a regular commentator on U.S. foreign policy and Iran on NPR, PBS, C-SPAN and the Voice of America.