A protester with Yemeni, Egyptian, Libyan and Syrian flags painted on his face chants slogans during a demonstration Wednesday in Sanaa, Yemen, against a deal that grants immunity for President Ali Abdullah Saleh.

Hani MohammedAP

Yemeni President Ali Abdullah Saleh accepted a deal Wednesday to end his more than three decades in power, making him the latest leader to be ousted in the Arab Spring uprisings.

Saleh flew to Saudi Arabia early Wednesday and signed the agreement at a ceremony in the capital city of Riyadh. The accord, brokered by the Gulf Cooperation Council, shifts power to Vice President Abdo Rabu Mansour Hadi within 30 days.

Dressed in a dark business suit, Saleh smiled as he signed the pact and clapped his hands a few times. He then spoke for a few minutes to members of the Saudi royal families and international diplomats, promising to cooperate with the new Yemeni government.

"This disagreement for the last 10 months has had a big impact on Yemen in the realms of culture, development, politics," he said, "which led to a threat to national unity and destroyed what has been built in past years."

The deal also calls for early presidential elections within 90 days, as well as 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.

U.S. State Department spokesman Mark Toner said Washington applauds the decision for a peaceful and orderly transition of power.

Saleh will have immunity from prosecution — contradicting a key demand of Yemen's opposition protesters who have been in the streets since January demanding the fall of the regime.

In the past, Saleh has promised to step down only to renege later, so Wednesday's announcement was initially greeted with a degree of skepticism.

But demonstrators said Saleh's resignation wasn't enough.

Protest organizer Walid al-Ammar 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 told The Associated Press in Sanaa. "For us, the revolution continues in the square."

U.N. Secretary-General Ban Ki-moon said Wednesday that the Yemeni leader had told him he planned to travel to New York for medical treatment.

Saleh had clung to power despite the months-long 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.

His ouster after 33 years in power follows the removal of Tunisian President Zine el-Abidine Ben Ali in January, Egyptian President Hosni Mubarak in February and Libyan dictator Moammar Gadhafi, who was killed by opposition fighters last month.

In recent days, unrest has also rekindled in Egypt, where Mubarak's departure left the military in charge, and in Bahrain, where police and demonstrators clashed Wednesday ahead of a report on security forces' crackdown on protests earlier this year.

Report Details Crackdown Abuses In Bahrain

In a stinging blow to Bahrain's leaders, a special commission that investigated the kingdom's unrest charged Wednesday that authorities used torture, excessive force and fast-track justice in crackdowns on the largest Arab Spring uprising in the Gulf.

The head of the commission, Mahmoud Cherif Bassiouni, also said there was no evidence of Iranian links to Bahrain's Shiite-led protests — a clear rebuke of Gulf leaders who have accused Tehran of playing a role in the 10-month-old revolt in the Western-allied kingdom.

The study, which focused on the period between Feb. 14 and March 30, was authorized by Bahrain's Sunni rulers in a bid to ease tensions. It marks the most comprehensive document on security force actions during any of the uprisings that have flared across the Arab world this year.

"The kingdom of Bahrain has sort of billed this as a moment of reconciliation, a time to put ... the past behind them and move on," NPR's Kelly McEvers reported. "However, as we're seeing around the island yesterday and today, the sense of reconciliation is not here."

Bahrain's Sunni government promised "no immunity" for anyone suspected of abuses and said it would propose creating a permanent human rights watchdog commission.

"All those who have broken the law or ignored lawful orders and instructions will be held accountable," read a government statement. It also said the report acknowledges that the "systematic practice of mistreatment" ended shortly after martial law was repealed on June 1.

Bassiouni's summary, read at a news conference attended by Bahrain's king, confirmed expectations that the report would be highly critical of officials in the strategic kingdom, which is the home to the U.S. Navy's 5th Fleet.

In a statement released Wednesday afternoon, the White House said it welcomed the report and commended Hamad's decision to establish the committee.

"It is now incumbent upon the Government of Bahrain to hold accountable those responsible for human rights violations and put in place institutional changes to ensure that such abuses do not happen again," the statement said.

In Cairo, Fighting Flares For A Fifth Day

In Egypt's Tahrir Square, the site of mass protests that brought down Mubarak nine months ago, police clashed with anti-government protesters for a fifth day as a rights group raised the overall death toll from the ongoing unrest to 38.

NPR's Soraya Sarhaddi Nelson, reporting from Cairo, said the clashes between protesters and security forces in a street leading to the Interior Ministry appeared to be "the most intense effort in days to dislodge protesters."

"They are firing a lot of tear gas," she said.

The fresh violence comes a day after tens of thousands of protesters in Tahrir Square rejected a promise by Egypt's ruling military council to push up presidential elections to the first half of next year.

The military had floated late next year or early 2013 as the likely date for the vote — the last step in the process of transferring power to a civilian government after Mubarak's ouster. Protesters have demanded an immediate handover.

But Tuesday's televised announcement by the country's top military ruler, Field Marshal Hussein Tantawi, didn't have its intended effect. To many Egyptians, it was reminiscent of the indignant speeches given by Mubarak just days before he was forced from power.

The Tahrir crowd, along with protesters in a string of other cities across the nation, want the military rulers to hand power immediately to an interim civilian council, which would run the nation's affairs until elections for a new parliament and president are held.

The government offered more concessions on Wednesday, ordering the release of 312 protesters detained over the past days and instructing civilian prosecutors to take over a probe the military started into the death of 27 people, mostly Christians, in a protest on Oct. 9. The army is accused of involvement in the killings.

The military also denied that its troops around Tahrir Square used tear gas or fired at protesters, an assertion that runs against numerous witness accounts that say troops deployed outside the Interior Ministry were firing tear gas at protesters.

Wednesday's street battles centered around the heavily fortified Interior Ministry, near the iconic square, with police and army troops using tear gas and rubber bullets to keep the protesters from storming the ministry, a sprawling complex that has long been associated with the hated police and Mubarak's former regime.

With reporting from NPR's Kelly McEvers in Bahrain,Soraya Sarhaddi Nelson in Cairo and Eric Westervelt in Berlin. Material from The Associated Press was used in this story.