SANA, Yemen — An assault on Yemen’s capital rocked the transitional government on Sunday as fighters from a Shiite rebel group stormed through the city, seizing government buildings, state media facilities and military bases. The military broke apart, some units appeared to side with rebels, and the prime minister abruptly resigned.

By late Sunday night, President Abdu Rabbu Mansour Hadi announced that the rebels, known as the Houthis, had agreed to an immediate cease-fire and the formation of a new “technocratic national government.” Although the details remained vague, analysts said the Houthis’ control over the capital would give them the upper hand in dictating the terms of any agreement.

“The agreement will, of course, reflect the new realities on the ground, where the Houthis are much stronger than before,” said Ibrahim Sharqieh, a researcher at the Brookings Institution’s center in Doha, Qatar, who focuses on conflict resolution. But, he noted, “the Houthis are not yet strong enough that they are able to take power without the other parties.”

Jamal Benomar, the special representative of the United Nations for Yemen, had announced a cease-fire on Saturday night, but it did not last until dawn. Nor did it impede the Houthis’ swift advance.