TRIPOLI/BENGHAZI, Libya (Reuters) - Libya’s rival parliaments agreed on Wednesday to work together to reform state institutions in an attempt to unify government authority in the oil producer, officials from both sides said.

The North African country has two governments, the U.N.-backed administration in Tripoli and a rival one based in the east, part of an ongoing power struggle since the overthrow of Muammar Gaddafi in 2011.

There is a House of Representatives (HoR) based in the east and a consultative body State Council backed by lawmakers from a previous assembly.

Both agreed to work toward a unified Presidential Council (PC) made up of a president, two deputies and a prime minister “to end (the) division,” HoR lawmaker Abdulsalam Nusia said on Twitter, posting a joint statement.

Spokespeople from the HoR and the State Council confirmed both sides had signed the agreement.

“The project to reform the executive branch and unify state institutions is a national project to end the division in the country,” the statement said.

Tripoli is home to a Presidential Council headed by Prime Minister Fayez Seraj but it is not recognized by the east.

The United Nations, which has been trying to mediate between the two sides to prepare the country for elections, gave a cautious welcome.

U.N. Special Envoy Ghassan Salame “received an update on the progress achieved in the political talks between the two bodies and received a joint document of PC restructuring mechanism,” its Libya mission said in a statement.

Unifying state bodies would be a step forward, but questions remain whether militias and armed groups will accept a deal since they benefit from the country’s chaos.

Tripoli’s government is backed by several armed groups while in the east Khalifah Haftar has emerged as key commander of his LNA troops.