The Libyan government has called on the United Nations and international community to help fight what it called a war on terrorism as it struggles to stop the country sliding into widening chaos and instability.

The appeal came after a wave of bombings and assassinations in the eastern city of Benghazi and clashes between pro-government forces and a rebel militia controlling major oil ports in Sirte in central Libya.

The violence is part of turmoil in the North African country where the government in unable to control militias that helped overthrow Muammar Gaddafi in 2011 but kept their weapons to grab oil wealth and power.

"Terrorist groups" had declared war on Benghazi, Sirte and other cities, the government said. A powerful car bomb targeting an army academy killed at least eight people in Benghazi on Monday.

"Libya's interim government asks the international community and especially the United Nations to provide assistance to uproot terrorism," the government said in a statement posted on its website late on Wednesday.

"The government confirms that it wants this war on terror and its crimes to start as soon as possible," it said.

The weak central government did not say what kind of help it expected. Western, Arab and African countries have been training thousands of Libyans to build up an army and police but progress has been slow.

Major oil facilities are out of control of the Tripoli government since armed groups and tribesmen seized them, knocking down oil exports, the country's lifeline, to a trickle.

The government has said it will end, if necessary by force, a blockage of major ports in the oil-rich east by a rebel group demanding regional autonomy and more oil revenues. But analysts are sceptical the nascent army can confront the group.

The rebel militia group managed earlier this month to load oil for export onto a tanker but US Navy Seals stormed the vessel off the Cyprus coast on Sunday.