SANAA, Yemen — Heavily armed Yemeni Shiite militiamen took over the headquarters and house of a powerful army general allied to Sunni Islamists on Monday and set up checkpoints across the capital, Sanaa, after sweeping across the city as the general and his allies fled and went into hiding.

The move against Maj. Gen. Ali Mohsen al-Ahmar consolidated the Hawthi rebels' grip over Sanaa after a week of deadly battles. The group had seized a series of strategic installations, key state buildings in Sanaa in recent days but later handed most of them over to military police.

It was the latest development in the Hawthi rebels' blitz, which has plunged volatile Yemen into more turmoil. After a week of fierce clashes that killed at least 140, the U.N. envoy to Yemen, Jamal Benomar, succeeded in mediating a deal that halted violence.

Fighting between the Shiite Hawthis and pro-Islamist militiamen died down and Sanaa was quiet on Monday. However, thousands of Hawthi fighters were out on the streets, the only visible force except Yemeni military police guarding state institutions.

Thousands of residents had already fled the city, while those who stayed hunkered down in their homes, fearful of new clashes, looting and robberies. Long lines of cars loaded with suitcases and food were seen leaving the capital for the countryside.

The Hawthis signed the U.N.-brokered deal on Sunday, an agreement that gave them unprecedented influence in the presidency and over the Cabinet. It calls for an immediate cease-fire and the formation of a technocratic government within a month after consultations with all political parties.

According to the deal, President Abed Rabbo Mansour Hadi is to appoint key advisers — from both the ranks of the Hawthis and the pro-separatist factions in the south.

The UN-brokered agreement sets Yemen on a new political path, one in which longtime power centers such as the Islah party, the political arm of the Muslim Brotherhood group, and its key ally — the Al-Ahmar tribe — as well as loyal generals are forced out of the power-sharing scheme.

The Hawthis claim they are not seeking power but revolting against a corrupt government. Critics believe the group is carrying out a power grab and that it is heavily supported by Iran.

But even as the U.N. deal was signed on Sunday, the Hawthis captured the headquarters of the army's 1st Armored Division, an elite outfit led by Ali Mohsen al-Ahmar, who has carried out several military campaigns against the Hawthis in the north.

On Monday, Hawthi fighters seized a large amount of weapons from the army headquarters and were seen transporting it out of Sanaa, possibly to their northern strongholds. Dozens of tanks and armored vehicles were seen being taken out of the barracks.

Yemen, one of the Arab world's poorest nations, is facing multiple challenges. In addition to the Hawthi rebels, an al-Qaida branch in the south poses a constant threat as it tries to impose control over cities and towns. Washington considers the Yemeni branch to be the world's most dangerous arm of al-Qaida and has helped support Yemeni government offensives against it with drone strikes.

As for the Hawthis, they waged a six-year insurgency that officially ended in 2010. The following year, an Arab Spring-inspired uprising forced then-President Ali Abdullah Saleh to step down in 2012 as part of a U.S.-backed deal giving him immunity from prosecution.

Al-Ahmar, a powerful Sunni tribal leader and a former confidant of Saleh's, switched sides during the uprising and was instrumental in ousting the president.

He led a succession of six local wars against the Hawthis, from 2004 until 2010, with battles taking place mainly in the rebels' northern heartland. The fighting left the Hawthis with deep enmity for the general and his allied Sunni Islamists.

The rebels' blitz into Sanaa forced al-Ahmar on the run and his present whereabouts were unknown, security officials said Monday, speaking on condition of anonymity because they were not authorized to speak to the media.