Yemeni President Ali Abdullah Saleh plans to sign a deal on Wednesday in the Saudi capital that could mean the end of his 33-year rule, the U.N. envoy to Yemen said.

Mr. 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 Mr. Saleh’s regime.

The uprising has led to a countrywide security collapse, with armed tribesmen battling security forces in different regions and al-Qaeda-linked militants stepping up operations in the country’s restive south.

For months, the U.S. and other world powers have tried to get Mr. 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 on 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 Mr. Saleh would sign the deal at a ceremony in the Saudi capital Riyadh later in the day.

The plan calls for a power transfer to Mr. Saleh’s vice president, Abed Rabbo Mansour Hadi, within 30 days, followed by a transitional period in which a national unity government will amend the constitution and work to restore security. The deal gives Mr. Saleh immunity from prosecution.

Mr. 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 Mr. Saleh flew to Saudi Arabia early Wednesday before the announcement was made.

Yemeni state TV reported on Mr. Saleh’s arrival in Riyadh and said Gulf Arab representatives who sponsored the agreement and European and American envoys would also attend the signing.

Mr. 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.

But their uprising, inspired by other Arab revolts in the region that saw long-time 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 Mr. Saleh, in fighting that has escalated in recent months.

Security is particularly bad in southern Yemen, where al-Qaeda 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.

More In: International | News