A little under two years ago, Philip Hammond, the Defence Secretary, urged British businessmen to begin “packing their suitcases” and to fly to Libya to share in the reconstruction of the country and exploit an anticipated boom in natural resources.

Yet now Libya has almost entirely stopped producing oil as the government loses control of much of the country to militia fighters.

Mutinying security men have taken over oil ports on the Mediterranean and are seeking to sell crude oil on the black market. Ali Zeidan, Libya’s Prime Minister, has threatened to “bomb from the air and the sea” any oil tanker trying to pick up the illicit oil from the oil terminal guards, who are mostly former rebels who overthrew Muammar Gaddafi and have been on strike over low pay and alleged government corruption since July.

Download the new Independent Premium app Sharing the full story, not just the headlines

As world attention focused on the coup in Egypt and the poison gas attack in Syria over the past two months, Libya has plunged unnoticed into its worst political and economic crisis since the defeat of Gaddafi two years ago. Government authority is disintegrating in all parts of the country putting in doubt claims by American, British and French politicians that Nato’s military action in Libya in 2011 was an outstanding example of a successful foreign military intervention which should be repeated in Syria.

In an escalating crisis little regarded hitherto outside the oil markets, output of Libya’s prized high-quality crude oil has plunged from 1.4 million barrels a day earlier this year to just 160,000 barrels a day now. Despite threats to use military force to retake the oil ports, the government in Tripoli has been unable to move effectively against striking guards and mutinous military units that are linked to secessionist forces in the east of the country.

Libyans are increasingly at the mercy of militias which act outside the law. Popular protests against militiamen have been met with gunfire; 31 demonstrators were shot dead and many others wounded as they protested outside the barracks of “the Libyan Shield Brigade” in the eastern capital Benghazi in June.

Though the Nato intervention against Gaddafi was justified as a humanitarian response to the threat that Gaddafi’s tanks would slaughter dissidents in Benghazi, the international community has ignored the escalating violence. The foreign media, which once filled the hotels of Benghazi and Tripoli, have likewise paid little attention to the near collapse of the central government.

The strikers in the eastern region Cyrenaica, which contains most of Libya’s oil, are part of a broader movement seeking more autonomy and blaming the government for spending oil revenues in the west of the country. Foreigners have mostly fled Benghazi since the American ambassador, Chris Stevens, was murdered in the US consulate by jihadi militiamen last September. Violence has worsened since then with Libya’s military prosecutor Colonel Yussef Ali al-Asseifar, in charge of investigating assassinations of politicians, soldiers and journalists, himself assassinated by a bomb in his car on 29 August.

Rule by local militias is also spreading anarchy around the capital. Ethnic Berbers, whose militia led the assault on Tripoli in 2011, temporarily took over the parliament building in Tripoli. The New York-based Human Rights Watch has called for an independent investigation into the violent crushing of a prison mutiny in Tripoli on 26 August in which 500 prisoners had been on hunger strike. The hunger strikers were demanding that they be taken before a prosecutor or formally charged since many had been held without charge for two years.

The government called on the Supreme Security Committee, made up of former anti-Gaddafi militiamen nominally under the control of the interior ministry, to restore order. At least 19 prisoners received gunshot shrapnel wounds, with one inmate saying “they were shooting directly at us through the metal bars”. There have been several mass prison escapes this year in Libya including 1,200 escaping from a prison after a riot in Benghazi in July.

The Interior Minister, Mohammed al-Sheikh, resigned last month in frustration at being unable to do his job, saying in a memo sent to Mr Zeidan that he blamed him for failing to build up the army and the police. He accused the government, which is largely dominated by the Muslim Brotherhood, of being weak and dependent on tribal support. Other critics point out that a war between two Libyan tribes, the Zawiya and the Wirrshifana, is going on just 15 miles from the Prime Minister’s office.

Diplomats have come under attack in Tripoli with the EU ambassador’s convoy ambushed outside the Corinthia hotel on the waterfront. A bomb also wrecked the French embassy.

One of the many failings of the post-Gaddafi government is its inability to revive the moribund economy. Libya is wholly dependent on its oil and gas revenues and without these may not be able to pay its civil servants. Sliman Qajam, a member of the parliamentary energy committee, told Bloomberg that “the government is running on its reserves. If the situation doesn’t improve, it won’t be able to pay salaries by the end of the year”.