(CNN) -- "Forty years of tyranny has left Libya fractured and without strong civil institutions. The transition to a legitimate government that is responsive to the Libyan people will be a difficult task."
Those were the words of President Barack Obama on March 28 2011, as he justified U.S. military action to prevent then-Libyan leader Moammar Gadhafi from attacking Benghazi. But the "difficult" has become virtually impossible. Assassinations, kidnappings, blockades of oil refineries, rival militias battling on the streets, Islamist extremists setting up camps, and above all chronically weak government have all made Libya a dangerous place and one whose instability is already spilling across borders and into the Mediterranean.
What's going on?
A former officer in Gadhafi's army, Khalifa Haftar, has decided he's had enough of the chaos. Haftar -- who spent nearly two decades living in Virginia after falling out with Gadhafi -- returned to Libya in 2011 to join the rebels and became one of their top military figures.
Those who served under him describe him as a soldier's soldier, a professional with a good military brain. But he is also seen as an opportunist and his long absence -- spending 20 years in America -- has made him suspect to some.
Haftar is scathing of the transitional government's weakness in the face of radical Islamist militias in the east that are blamed for the assassinations of judges, police and military commanders. In February he appeared on national television -- in uniform -- and said the government should be replaced.
Last Friday, "troops" loyal to him (rather than to the Libyan government) began an offensive against powerful Islamist militia in Benghazi. Among their targets: Ansar al Sharia, who the White House holds responsible for taking part in the assault on the U.S. diplomatic compound in the city in September 2012.
At least 70 people were killed in the clashes and many more wounded, according to hospital officials. The government, army and parliament all condemned Haftar, saying his actions amounted to a coup attempt. He responded: "There's no turning back," describing his offensive as "Operation Dignity."
Haftar appears to have the support of important tribes in eastern Libya as well as the commander of Libyan Special Forces in Benghazi, which have also been involved in clashes against Ansar al Sharia, and the air force base in Tobruk.
His playbook may come from the East -- from Egypt. There, a crumbling economy and growing political violence led the army to intervene, replacing the Muslim Brotherhood government, and a new "strongman" to emerge.
"Partly inspired by Egyptian General Abdel Fattah El-Sisi, Haftar seems determined to challenge the status quo and put an end to the current situation of chaos" in Libya, says analyst Riccardo Fabiani of Eurasia Group, who is in Tripoli.
Whether Haftar can create a national coalition capable of imposing order seems unlikely. He does appear to have the support of two militia from Zintan, in western Libya, who launched a gun attack on the General National Congress (or transitional Parliament) in Tripoli on Sunday. But they in turn were confronted by pro-Islamist militia. And some of the most powerful groups, based in Misrata, have made it clear they will thwart him.
Just how bad is it?
There is effectively no rule of law in Libya -- no national police force, no working judiciary, no coherent government -- but there are as many as 200,000 men with guns, according to some estimates. As "revolutionary fighters" they even get government money, although only a minority were actually involved in the revolt against Gadhafi. That incentive has only encouraged the formation of more militias.
Libya has become a patchwork of hundreds of Islamist and tribal militias vying with each other for power. Their geographical, tribal and political affiliations vary. They are well-armed and relied on by the government to help provide security. But it's very much on their terms. One group even hijacked an oil tanker in March, took it into international waters and tried to sell the crude on board. US Navy SEALS boarded the vessel and returned it to the government.
In the east, assassinations are an almost daily occurrence. Islamist militia are well entrenched in Benghazi and Derna. And in Tripoli, security has deteriorated. When an armed group wants something it surrounds ministries or invades the General National Congress (GNC).
The current prime minister, Abdullah al Thinni, and his family were attacked days after his appointment in April, leading him to resign. The Jordanian ambassador was kidnapped and only released when a Libyan militant in a Jordanian jail, Mohammed al-Drissi, was returned to Libya. It's unclear whether al Drissi is now free. Two Tunisian embassy staff are still missing; their captors want Islamist comrades in Tunisian jails set free. The Algerians closed their mission in Tripoli after an attempt last week to kidnap the ambassador.
The GNC has been wracked by in-fighting, most notably during a much-disputed vote on a new prime minister two weeks ago. It has essentially become an extension of the militias, with Islamist groups wielding most influence. The outgoing government has proposed it should go into recess until the fall.
All the while, the economy has been going south. After an initial spike in oil production, which historically provides about 90% of Libya's revenues, blockades and strikes have drastically reduced output. The government has been working without a budget, but has raised wages and food subsidies to buy social peace. Fraud and corruption are rampant; a bloated payroll for state workers is inflated further by the fact that some claim two salaries. The result is a $4 billion deficit.
What's the government doing about the chaos?
Not much. Progress toward building a national army and police force in the wake of Gadhafi's ousting has been painfully slow. One of the problems is the way the revolt against Gadhafi evolved -- with different groups emerging in the east and west, not coordinated (and in some cases hostile to each other), but well-armed thanks to the huge armories Gadhafi had built up as well as generous suppliers of weapons like Qatar. These groups then bargained over the spoils of victory. The Misrata militia control the Defense Ministry; the Zintan militia the Interior Ministry.
Making threats has paid off: "Groups which have pursued their objectives through threats, force, blockades and boycotts have been rewarded with their agendas," the Atlantic Council concludes in a new report. It urges the government to assert its authority and end appeasement of the different groups that have brought Libya to the brink of chaos. Easier said than done. As the authors acknowledge, these groups are in the government, and can bring down any prime minister who threatens their interests, as well as deny the resources needed to build an effective military.
Asked by foreign governments to confront radical groups and establish a national army, Libyan ministers have long insisted (to former U.S. ambassador Chris Stevens among many others) that painstaking negotiation and compromise is the only way forward. Libya's transitional government has effectively been paying huge sums to militias as protection money, to allow the politicians to stay in office, while real power is wielded at the local level.
Is Gadhafi to blame?
During more than four decades ruling Libya, Gadhafi ensured that no institutions grew up to challenge him -- army, parliament, judiciary or any sort of civil society. He ruled in an arbitrary fashion and suppressed or manipulated Libya's many tribal and ethnic divisions. When he was gone these exploded into the open.
Despite inheriting few foundations on which to build, the transitional government failed to begin a process of national reconciliation and was reluctant to accept foreign help in building a new society. A window of opportunity in 2012 -- when the GNC was elected in a peaceful nationwide vote and oil exports increased -- was squandered.
Libyans have gradually given up on the GNC as it has failed to produce a new constitution -- a function now delegated to the recently elected Constituent Assembly -- or show any semblance of competence. Their disillusionment is shown by how few registered to vote for the Constituent Assembly election.
Instead, many Libyans have turned to local forces for protection and income. Places like Misrata are essentially city states, protecting themselves and immune to anything the central government says.
Do events in Libya really matter beyond Libya?
They do. Libya is the fourth largest country in Africa and borders six other states, including Egypt, Algeria and Tunisia. To the south, it has long, unpoliced borders in areas where al Qaeda in the Islamic Maghreb (AQIM) is active. Some of the group's commanders are thought to have established ties with extremist groups in Libya, and have bought weapons looted from Gadhafi's bases that are now traded on the black market.
According to a U.N. Security Council report in February, Libyan weapons allegedly have been trafficked to 14 countries, including portable ground-to-air missiles. "Trafficking from Libya was fueling conflict and insecurity -- including terrorism -- on several continents," the report concluded. "Thousands of tons of ammunition are still unsecured in the country," it added.
Hundreds of young militants from Libya have gone to fight in Syria and Iraq, some returning home with a rolodex of jihadist contacts and battle training. And intelligence officials say Islamist groups have set up training camps in the mountains between Derna and Benghazi in the east. There are growing signs of co-operation between these groups and al Qaeda affiliates.
Libya's oil output is also important, especially to the countries of southern Europe. Nearly a quarter of its high-quality crude goes to Italy, and it has proven oil reserves of 48 billion barrels, as well as many areas still to be explored. While it's way behind the Gulf states in terms of production, the absence of Libyan oil from the market -- through blockades, strikes and a lack of foreign investment -- moves prices.
Finally Libya matters because it has become an illicit gateway to Europe for thousands of would-be migrants from Africa. The collapse of the central government has made the country a preferred route for human traffickers, as a rising tide of desperate people from Eritrea, Somalia and now even Syria try to cross the Mediterranean in decrepit vessels.
"The EU cannot afford to have a failed state crucial to energy security and to stemming illegal trafficking 350 kilometers south of Malta," says Mattia Toaldo of the European Council on Foreign Relations.
Much depends on whether Haftar can generate momentum, tapping into a deep vein of frustration among ordinary Libyans. In the view of Mohammed Eljarh, writing in Foreign Policy, "Haftar is positioning himself as Libya's terrorism fighter and sending a message to Libyans and regional powers like Egypt and the United States that he is their winning card to fight terrorism in post-revolution Libya."
It may be that his offensive will further separate the east from Tripoli. Some in Benghazi even dream of de facto independence for what's known as Cyrenaica, the eastern half of Libya that's often been neglected by Tripoli.
Analysts predict Haftar's actions will further polarize the country, with pro-Islamist militia like the Libyan Shield joining forces against him. It doesn't help that influential Gulf states have their own clients in Libya and are treating the current crisis as a proxy battleground.
In the view of Riccardo Fabiani, of the Eurasia Group: "Any attempt to carry out a coup is destined to fail due to the lack of a central authority capable of imposing a minimal degree of order."
If Haftar puts together a "coalition of militias opposed to the Islamist camp, this will trigger a major reaction from the other side and will bring the country closer to civil war," Fabiani says.
The people of Libya have in the past briefly and bravely protested against the excesses of the militias. Thousands turned out in Tripoli last November, but more than 30 were killed for daring to demonstrate, and there is no political outlet through which young Libyans can demand a better future.
Many analysts argue that Libya needs a government that will use the country's oil wealth to co-opt the local powers that have sprung up and cut off the generous stipends that fund the militias, while looking to foreign governments to help build a small but effective army. But first any government needs to be able to protect itself.
Eljarh is one of many who believe the situation will get worse before it gets better.
"At this point, a peaceful political settlement between these competing factions in Libya is hard to imagine," he says.