The head of Libya's self-declared government in Tripoli has called for fresh elections to pull the country back from chaos, as fighting in the restive east pushes the country deeper into instability.

Omar al-Hassi called for a vote on Monday, less than six months after the country elected a new parliament, which fled to Tobruk in the summer, to end years of conflict and turmoil.

Hassi told the AFP news agency that the country needed to vote as the internationally recognised Tobruk-based parliament had "lost its legitimacy".

Live Box 2014526124723906113

"This parliament is no longer accepted in Libya. It has lost its legitimacy. We need new elections," the 55-year-old academic said.

Hassi's Islamist-dominated parliament, the General National Congress (GNC), has refused to recognise the Tobruk parliament, which is dominated by liberals and federalists.

Libya is divided between rival tribes and political factions with two governments vying for legitimacy since an armed group from the western city of Misrata seized Tripoli in August, forcing Prime Minister Abdullah al-Thinni to move east.

The political rivalry has been coupled with militia infighting, which has swept across the North African nation, and threatened to spill over into neighbouring countries.

Struggle for power

On Monday, a Libyan navy ship docked at Benghazi port was hit during heavy fighting between the army and Islamist fighters in Libya's second-largest city, residents said.

Libya's army had earlier urged residents to evacuate a central district of the city, as it prepared a military operation against an alliance of fighters and ex-rebels, a spokesman said.

"The chief of staff asks all residents of the Assabri district to leave by 12:00 noon [on Monday]," Ahmed al-Mesmari, spokesman for the chief of staff, said on Sunday.

Is Libya a failed state?

At least 230 people have been killed since the army, backed by forces loyal to a former general, waged an offensive against armed groups in the eastern city, part of chaos plaguing the oil producer three years after the ousting of former leader Muammar Gaddafi.

The army claims to have seized back several barracks it had lost to the armed fighters in August, though fighting has been continuing in other parts of the eastern city.

The situation in Benghazi and other parts of Libya has been fluid with government forces unable to control armed groups.

Forces of retired general Khalifa Haftar, which support the army in Benghazi, have planes from Libya's outdated air force though his opponents say he also gets air support from Egypt, which is worried about the spread of armed groups.

Haftar and Cairo deny this.

Source: Agencies