Politicians from Libya's rival parliaments have reached a power-sharing agreement in Tunisia, shunning a UN-brokered deal aimed at ending the conflict.

Speaking at a press conference, the internationally recognised government's representative Ibrahim Amash announced they struck a separate deal with the Islamist government to avoid the "foreign intervention" tainting the UN-sponsored agreement.

The UN deal was drafted by its former envoy to Libya, Bernardino Leon, who accepted a job last month from the United Arab Emirates, which backs one side of the conflict, casting doubts on the international body's neutrality.

Libya slid into chaos following the 2011 toppling and killing of long-time dictator Muammar Gadhafi.

The oil-rich country has been torn between an internationally recognised government in the far east and Islamist-backed government in the capital, Tripoli.

However, it appears the deal has failed to gain broad acceptance by either side, with representatives from both parliaments coming out to criticise the newly minted agreement.

"We believe this is a step on the right track away from intervention of foreign entities and manipulation," prominent internationally recognised parliament member Abu Bakr Beira said in the eastern city of Tobruk, where his parliament is based.

Meanwhile, his parliament's spokesman told The Associated Press the new deal does not represent the body.

"This is an individual effort and a childish attempt to get out of signing the real peace deal," Faraj Abu Hashim said.

If successful, the deal would see the formation of two 10-member committees, with both camps enjoying equal representation. One committee will form the unity government in the next two weeks and the other will draft a constitution and prepare for parliamentary elections within two years.

According to the media offices of both parties, nearly half the members of each body are still in favour of the UN deal despite Mr Leon's departure, albeit with conditions. The UN has repeatedly refused to reconsider changing the proposal.

The UN deal due for endorsement next week in Rome had been rejected by the internationally recognised government because it would have given the unity government the power to fire all senior Libyan officials not unanimously approved by its members - a clause they interpreted as an attempt to remove their fiercely anti-Islamist army chief, General Khalifa Hifter, whose forces have been battling Islamist militias nationwide for over a year.

The Islamist authorities, on the other hand, were unhappy with the deal because it did not provide sufficient guarantees that Islamic law will be applied, officials said.

Western officials have urged the Libyan governments to act quickly and reach a deal, warning that the instability in the country was giving room for extremist groups like the Islamic State to expand.

Libya's chaos has opened the door to a surge of migrants and refugees who set off from its coast for Europe in often rickety boats operated by smugglers. Many have died on the journey.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.