Sanaa (AFP) - Rival groups in Yemen signed a UN-brokered peace deal on Sunday after Shiite rebels seized the government headquarters and the prime minister resigned in the face of raging violence."A national peace and partnership agreement based on the outcomes of the national dialogue conference was signed this evening at the presidential palace" in Sanaa, state news agency Saba reported.President Abdrabuh Mansur Hadi, United Nations envoy Jamal Benomar and representatives of Yemen's political forces, including the Huthi rebels, attended the signing ceremony, it reported.In a speech, Hadi said: "We have reached a final deal with which we can overcome this crisis."Benomar said the agreement calls for the formation of a government of technocrats within one month.Under the deal, Hadi will also appoint advisers from the Shiite Ansarullah rebels and southern separatists within three days, Benomar said at the signing ceremony broadcast on state television.The rebels earlier Sunday swooped on key institutions across Sanaa, including the government headquarters and military sites, after an apparent surrender by security forces.And Prime Minister Mohamed Basindawa resigned, accusing Hadi of being "autocratic", according to the text of his resignation letter released by the council of ministers."The partnership between myself and the president in leading the country only lasted for a short period, before it was replaced by autocracy to the extent that the government and I no longer knew anything about the military and security situation," he wrote.In a sign of the confusion sweeping Sanaa, Saba quoted a presidency source as saying Hadi had not received the letter, "therefore the government remains headed by Mohamed Salem Basindawa".- 'Don't confront rebels' -The rebels also overran state radio, the general command of the armed forces, headquarters of the sixth military region, the fourth brigade and the defence ministry's media arm, official and rebel sources said.They swept into the parliament building and took over the central bank and civil aviation authority, the sources said.The interior ministry's website urged security forces not to confront the insurgents.Interior Minister Abdo al-Tarib instead urged "cooperation" with the rebels "to strengthen security and stability, preserve public property and guard government installations...