U.N. Secretary-General Ban Ki-moon says Yemeni President Ali Abdullah Saleh has told him he will travel to New York for medical treatment after signing an agreement to end his 33-year rule. 
 
 Ban told reporters Wednesday that he talked with Saleh by telephone, and would be happy to meet with him in New York. He provided no information about when Saleh planned to arrive in New York, nor what treatment he would be seeking. 
 
 Saleh's signature on an accord brokered by Yemen's powerful Gulf Arab allies would start a new chapter in the nine-month popular uprising that has shaken the Arab world's poorest country. Saleh has repeatedly agreed to sign the deal, only to back away at the last minute. 
 
 THIS IS A BREAKING NEWS UPDATE. Check back soon for further information. AP's earlier story is below. 
 
 SANAA, Yemen (AP) _ Yemeni President Ali Abdullah Saleh plans to sign a deal Wednesday in the Saudi capital that could mean the end of his 33-year rule, the U.N. envoy to Yemen said. 
 
 Saleh's signature on the Gulf-brokered accord _ if he goes through with it _ would start a new chapter in the nine-month popular uprising that has shaken the Arab world's poorest country. Since January, tens of thousands of Yemenis have protested in cities and towns across the nation, calling for democracy and the fall of Saleh's regime. 
 
 The uprising has led to a countrywide security collapse, with armed tribesmen battling security forces in different regions and al-Qaida-linked militants stepping up operations in the country's restive south. 
 
 For months, the U.S. and other world powers have tried to get Saleh to agree to a proposal sponsored by Yemen's powerful Gulf Arab allies to end the crisis. 
 
 Speaking to reporters in the Yemeni capital Wednesday, the U.N. Secretary General's special envoy to Yemen, Jamal bin Omar, said opposition and ruling parties agreed on a mechanism to carry out the plan and that Saleh would sign the deal at a ceremony in the Saudi capital Riyadh later in the day. 
 
 "The agreement is an important step for the people of Yemen to solve the political crisis in the country and move their country toward a better future," bin Omar said. 
 
 The plan calls for a power transfer to Saleh's vice president, Abed Rabbo Mansour Hadi, within 30 days and early presidential elections with in 90 days of the signing. It also calls for a two-year transition period in which a national unity government will amend the constitution, work to restore security and hold a national dialogue on the country's future. 
 
 The deal gives Saleh immunity from prosecution _ contradicting one key demand of Yemen's opposition protesters. 
 
 Saleh has repeatedly agreed to sign the deal, only to back away at the last minute. This time, though, a signing appeared more likely since Saleh flew to Saudi Arabia early Wednesday before the announcement was made. 
 
 Yemeni state TV reported on Saleh's arrival in Riyadh and said Gulf Arab representatives who sponsored the agreement and European and American envoys would also attend the signing. 
 
 A Saudi official said King Abdullah and Crown Prince Nayef were planning to attend the ceremony, expected to take play Wednesday evening. 
 
 In his statement, the U.N. envoy, bin Omar, praised Yemen's youth, saying the young people had "created the momentum" for change in the country and encouraging all "to invest in this historic opportunity." 
 
 Still, Saleh's signing is unlikely to appease the protesters on the streets, who demand more sweeping political changes. 
 
 Protest organizer Walid al-Ammar in Sanaa criticized the deal as a pact between Saleh's ruling party and a group of opposition parties, while ignoring protesters' demands. 
 
 "They agreed. That's their business," he said. "For us, the revolution continues in the square." 
 
 He said protesters set out not just to topple Saleh, but to get rid of corruption in Yemen's government. 
 
 "If we see that the corrupt system is removed, we'll welcome it," he said, "not just replacing the corrupt people with others." 
 
 Saleh has clung to power despite the 9-month-old uprising, daily mass protests calling for his ouster and a June assassination attempt that left him badly wounded and forced him to travel to Saudi Arabia for more than three months of hospital treatment. 
 
 The unarmed protesters have held their ground with remarkable resilience, flocking to the streets of Sanaa and other Yemeni cities and towns to demand reforms and braving a violent crackdown by government forces that has killed hundreds. 
 
 Their uprising, inspired by other Arab revolts in the region that saw longtime rulers of Egypt and Tunisia go, has at times been hijacked by Yemen's two traditional powers _ the tribes and the military _ further deepening the country's turmoil. 
 
 Breakaway military units and tribal fighters have been battling in Sanaa with troops loyal to Saleh, in fighting that has escalated in recent months. 
 
 Security is particularly bad in southern Yemen, where al-Qaida militants _ from one of the world's most active branches of the terror network _ have taken control of entire towns, using the turmoil to strengthen their position. 
 
 An impoverished nation of some 25 million people, Yemen is of strategic value to the United States and its Gulf Arab allies, particularly Saudi Arabia. It sits close to the major Gulf oil fields and overlooks key shipping lanes in the Red and Arabian seas. 
 
 ___ 
 
 Hubbard reported from Cairo. ||||| Anti-government protesters react as they celebrate the signing by Yemen's President Ali Abdullah Saleh of a deal to step down in Sanaa November 23, 2011. 
 
 Yemen's President Ali Abdullah Saleh speaks during a visit to a Republican Guards brigade loyal to him near Sanaa November 19, 2011. 
 
 A protester shouts and gestures during a demonstration against proposed immunity for Yemen's President Ali Abdullah Saleh under a Gulf Cooperation Council (GCC)-sponsored deal for his ouster in Sanaa November 23, 2011. 
 
 Anti-government protesters react as they celebrate the signing by Yemen's President Ali Abdullah Saleh of a deal to step down in Sanaa November 23, 2011. 
 
 RIYADH Yemeni President Ali Abdullah Saleh signed a deal on Wednesday under which he will step down after 33 years in power and 10 months of protests against his rule that brought the country to the brink of civil war. 
 
 Celebrations erupted in the capital Sanaa as Saleh inked the agreement that made him the fourth leader to be forced from power in 10 months of mass protests that have swept the Arab world. Yemenis danced in the streets, set off fireworks and waved flags as Saleh finally agreed to step down. 
 
 Under the agreement, signed with opposition leaders at a ceremony hosted by Saudi King Abdullah at the royal palace in Riyadh, Saleh will immediately transfer his powers to his deputy, Abd-Rabbu Mansour Hadi. In return he will retain the title of president until a new head of state is elected. 
 
 "I declare the turning of a new page in the history of Yemen," Saudi King Abdullah said in a brief statement before the signing ceremony, also attended by Crown Prince Nayef. 
 
 "Saudi Arabia will remain the best supporter for Yemen," the king added. 
 
 Hadi would form a new government with the opposition and call an early presidential election within three months. 
 
 "This is as honorable an exit as he (Saleh) can get, considering the circumstances," said Ghanem Nusseibeh, a London-based analyst. "But the key thing is how the deal will be implemented and if the coalition government will be strong enough to take charge of the whole country," he added. 
 
 The United States and the European Union hailed the accord. 
 
 "This represents an important step forward for the Yemeni people, who deserve the opportunity to determine their own future," President Barack Obama said in a statement. 
 
 The Pentagon said the United States and Yemen would continue to work together against militants. "Despite the political instability in Yemen, we have been able to preserve important counter-terrorism relationships with that country." 
 
 In Brussels, EU foreign policy chief Catherine Ashton said Saleh's signing of the deal should open the way to national reconciliation and a transition to democracy. 
 
 "The agreement is only the beginning, but it is a very important beginning. It allows the Yemeni people the much needed hope that their country can turn a page in its history and embrace a new future," she said in a statement. 
 
 Saudi state television broadcast live the signing ceremony, where Saleh was shown chatting and sipping traditional coffee with King Abdullah. Saleh spent three months in Riyadh undergoing treatment following an assassination attempt in June. 
 
 The attempt on Saleh's life came after he ducked out of the deal, which ushered in street battles that devastated parts of his capital Sanaa. 
 
 The 69-year-old leader, who has ruled Yemen since 1978, asked Saudi Arabia and members of the U.N. Security Council to ensure the implementation of the accord, brokered by Yemen's Gulf Arab neighbors. 
 
 "We aspire with confidence to the brothers in Saudi Arabia ... to review, help and oversee the implementation of the accord and the operational mechanism," he said. 
 
 MONTHS OF BLOODSTAINED PROTESTS 
 
 Hundreds of people have been killed during months of protests seeking Saleh's ouster. The political deadlock has reignited simmering conflicts with separatists and militants, raising fears that Yemen's al Qaeda wing could take a foothold on the borders of Saudi Arabia, the world's top oil exporter. 
 
 Details of the power transfer deal -- drawn up by Yemen's richer neighbors in the six-member Gulf Cooperation Council (GCC) earlier this year, and thwarted by Saleh on three separate occasions -- were hammered out by U.N. envoy Jamal Benomar, with support from U.S. and European diplomats. 
 
 "This is a very good day for Yemen and we hope it provides the framework for a reform process during the transition that will lead to...free and fair elections," he told Reuters at the signing ceremony. 
 
 U.N. Secretary-General Ban Ki-moon told reporters in New York that Saleh had told him in a telephone conversation on Tuesday that he intended to "come to New York to take medical treatment immediately after signing this agreement." 
 
 A Yemeni official had said on Tuesday that the accord was facing opposition from some senior politicians in Saleh's General People's Congress (GPC). 
 
 Saudi fears about chaos in Yemen are shared by Washington, which regards the country as a front line against al Qaeda and long backed Saleh as a key to its campaign against Islamist militants. 
 
 PROTESTERS DENOUNCE DEAL "WITHIN THE REGIME" 
 
 The deal to nudge him from power was denounced by some of the youth protesters who have emerged as a presence in Yemen's politics, and regard the parties that negotiated his exit partners in the crimes of which they accuse Saleh. 
 
 "We will remain on the streets until our demands are met," activist Samia al-Aghbari told Reuters. "Saleh's crimes won't end with time, so we will pursue him and all the killers." 
 
 But others welcomed the deal as a first victory of their uprising. 
 
 "This is a great victory," Badr Ali Ahmed, an activist at Change Square, said. "We have achieved one of the goals of the revolution, which is to bring down the head of the regime, and God willing we will achieve the rest." 
 
 Hamdan al-Haqab, a field organizer, said: "We were not part of this initiative, but since it happened, we consider it to be the first achievement of the revolution ... We will continue to achieve all our goals." 
 
 A Yemeni official said that renegade general Ali Mohsen, a longtime Saleh ally who turned on him after protests began, and Sadeq al-Ahmar, a tribal notable who also threw his weight against Saleh, could try to block the deal which excludes them. 
 
 Those figures, along with Saleh's son and a nephew who commands a key paramilitary unit, form a balance of forces on the ground that analysts say none is likely to tip, making a political resolution the only way out of Yemen's deadlock. 
 
 Witnesses said Ahmar fighters and Saleh forces traded shelling in the Soufan and al-Hasaba neighborhoods in Sanaa, where the tribal chief lives, and that sounds of explosions could be heard from a distance. 
 
 There were no reports of casualties. The area was the scene of heavy clashes earlier this year, where scores of people from both sides died. 
 
 (Additional reporting by Mohammed Ghobari in Sanaa; Writing by Sami Aboudi; Editing by Samia Nakhoul and Giles Elgood)
– Ali Abdullah Saleh resigned as president of Yemen today, signing a deal in Saudi Arabia to cede power to vice president Abed Rabbo Mansour Hadi until elections can be held in three months. The signing was aired on Saudi state-run TV, which showed a smiling Saleh sitting beside King Abdullah and clapping briefly. Yemeni opposition officials signed the deal soon after, according to Reuters. Saleh will now travel to New York for medical treatment, UN Secretary General Ban Ki-moon told the AP, though he didn’t specify what treatment Saleh might require, or exactly when he'd arrive.