Yemen's embattled president has reached an agreement with Houthi rebels to end a violent standoff in the capital, Sanaa.

The Shia rebels agreed on Wednesday to withdraw from areas overlooking the presidential palace and the private compound of the President, Abd-Rabbu Mansour Hadi, after receiving assurances of constitutional change and power-sharing.

In a statement issued late on Wednesday, Hadi said the Houthis had a right to serve in posts in all state institutions, and a draft constitution that had been a source of disagreement between him and the group was open to amendment.

He said the Houthis agreed to withdraw fighters from areas overlooking his palace, his private home and the official residence of the prime minister, as well as a missile base, and had promised to immediately free his chief of staff, whom they had held captive since Saturday.

"The draft constitution is subject to amendments, deletions, streamlining and additions," said the statement. All sides agreed government and state institutions, schools and universities should rapidly return to work, it added.

A source close to Hadi said the president met an official from the armed group, and denied reports the head of state was under house arrest, despite two days of pitched battles outside his home.

After clashes erupted at the president's office and home on Tuesday, the Houthi leader, Abdel-Malik al-Houthi, had threatened to take further "measures" unless Hadi bowed to his demand for constitutional changes that would increase Houthi power.

The Houthis, an ally of Iran, swept into the capital four months ago and have emerged as the dominant force in the country.

For now at least they appear to have decided to stop short of overthrowing Hadi, possibly preferring to exert control over a weakened leader rather than take on the burden of power.

'President free to leave home'

"President Hadi is still in his home. There is no problem, he can leave," Mohammed al-Bukhaiti, a member of the Houthi politburo, told Reuters.

Prime Minister Khaled Bahah quit his official residence, which had also been surrounded by Houthi fighters, for "a safe place after three days of siege", one of his aides told the Reuters news agency.

Yemeni military sources said the Houthis also seized the military aviation college close to Hadi's home, and the main missile base in Sanaa, without a fight.

In the south of the country, Hadi's home region, local officials denounced what they called a coup against him.

They shut the air and sea ports of the south's main city, Aden, and closed land entry routes.

Gulf Arab states, which support Hadi and oppose Iranian influence in the region, denounced what they called "terrorist" acts by the Houthis and their allies.

'Master of mischief'

The Houthis managed to rise to power after the country plunged into a state of turmoil following the ousting of Yemen's leader Ali Abdullah Saleh.

In a separate incident that has sparked further controversy involving Saleh, leaked telephone conversations have shown that Saleh was talking with Houthi rebels a month after the Shia group took control of capital Sanaa.

In the audio recording, received by Al Jazeera on Wednesday, Saleh is heard apparently coordinating military and political moves with Abdul Wahid Abu Ras, a Houthi leader.

The audio was reportedly recorded in October.

Speaking to Al Jazeera from London, Mohamed Qubaty, a former government adviser in Yemen, said that if the audio recordings are proven, it shows Saleh as "a master of mischief" in the country.

On Wednesday, Saleh called for early elections, arguing that early presidential and parliamentary polls would help defuse the current political crisis.