LIBYA'S beleaguered elected parliament has declared a formal alliance with a renegade former general, as it struggles to assert some authority in a country many fear is sliding into outright civil war.

Three years after the overthrow of Muammar Gaddafi, the oil-producing desert state is in chaos, with Islamists and other militias fighting for territory and influence and the regular armed forces reduced to near-impotence.

One faction has seized Tripoli, setting up its own assembly and administration in the capital and ­forcing the internationally-recognised government to take refuge in the east of the country.

Khalifa Haftar, a former general under Gaddafi, is one of dozens of commanders of irregular forces calling the shots in the country. Last week, his forces launched a new offensive against Islamist militias in the eastern city of Benghazi.

The House of Representatives, Libya's elected parliament which has relocated to Tobruk in the far east, has endorsed Haftar's Operation Dignity against Islamists, giving him an official role, parliament spokesman Farraj Hashem said.

"Operation Dignity is leading officers and soldiers of the Libyan army, Operation Dignity is an operation of the Libyan army," he said. The move appears in contradiction to past calls from the House of Representatives for all militias to be disarmed.