Yemen's main political factions, including the Houthi rebels, have signed an agreement mandating the president and prime minister to form a new government in an effort to defuse political tensions that have crippled the country.

Prime Minister Khaled Bahah will head the selection of the new ministers in consultation with President Abd-Rabbu Mansour Hadi, a statement emailed from the 13 political parties said.

"We, the political parties, ask President Abd-Rabbu Mansour Hadi and Prime Minister Khaled Bahah to form a competent national government ... which is committed to the protection of human rights, rule of law and neutrality in the management of affairs of the country," the statement said.

Saturday's statement did not mention when the new government would be formed, but a number of party members who were involved in the negotiations that led to Saturday's agreement said it could be in a few days or a week.

UN special envoy Jamal Benomar, who attended the meetings, told the Reuters news agency that, under the agreement, parties that do not have representatives in the president's advisory body will be allowed to nominate candidates for the different ministries.

"Following that, the prime minister will choose the more competent candidates for each posting," said Benomar.

'Compromise agreement'

Yemen's Shia Houthi rebels and their main rivals, the Sunni al-Islah Party were among the groups that signed the agreement. The agreement came hours after Houthi fighters attacked Islah's headquarters in the central province of Ibb, killing four guards.

The Houthis gave Hadi an ultimatum on Friday to form a government in 10 days or face "other options".

"It is a compromise agreed to overcome the question of sharing out ministerial portfolios between the various groups" behind the political stalemate, signatory Abdel Aziz Jubari of the liberal Justice and Construction party told the AFP news agency.

In recent months, the Houthis have become Yemen's power-brokers.They captured the capital in September, capitalising on protests and widespread anger following the government's announcement of a sharp rise in fuel prices.

Shortly after, the Shia rebels captured a number of key cities and towns, waging battles with opposing tribes and al-Qaeda-linked fighters.

Under a UN-sponsored accord signed last month, the Houthis were to withdraw from Sanaa and disarm once a neutral prime minister is named.

'Old wine in new bottles'

The rebels say they are filling the void left by the security forces.

But Hakim al-Masmari, editor-in-chief of Yemen Post, fears that they would do no more than "change their uniform".

"The Houthis are not going anywhere. They signed a deal that said that 30 days after a government is formed, their militants should be removed from the streets of Sanaa.

"But they are only changing their uniform. As of now, 2,000 militants or supporters have been added to the ranks of the police and defence ministry."

The Houthis have been repeatedly accused by authorities of having links with Iran.

Al Jazeera's Omar Al Saleh, reporting from Sanaa, said residents would be watching closely to see how Houthis in general would react to the agreement.

So far, violence has shown no signs of abating.

On Saturday, at least 20 soldiers and three suspected al-Qaeda fighters died in clashes in the town of Jabal Ras in Yemen's western province of Hodeidah, according to local officials and residents.