Yemeni President Ali Abdullah Saleh bowed to opposition demands Wednesday and effectively ended his 33-year rule, turning power over to his vice president in advance of elections early next year.

On the other side of the Arabian Peninsula, Bahrain’s ruling monarchy pledged reforms after welcoming the release of an independent investigation’s conclusion that government security forces tortured and otherwise abused pro-democracy protesters early this year, killing at least 30.

The separate events provided some breathing room for two countries roiled by the Arab Spring uprisings, and for the Obama administration, which has substantial security interests in both. Together with Saudi Arabia, the United States had pushed for Bahrain to put its house in order and for Saleh to leave. Saleh’s departure makes Yemen the fourth Arab country, following Tunisia, Egypt and Libya, in which longtime autocratic leaders were removed from power this year.

But in both Yemen and Bahrain, the calm posed new challenges and may turn out to be short-lived.

In Sunni-ruled Bahrain, human rights activists and leaders of the opposition Shiite majority said they were more interested in results than reports. They called for the immediate release of those detained since protests began in February, reinstatement of those purged from government jobs and universities, and the naming and punishment of those guilty of what the investigation report termed “torture.”

A Persian Gulf island that is host to the U.S. Navy’s 5th Fleet, Bahrain is a key part of the Obama administration’s hopes of maintaining a strong security presence in the region after the final withdrawal of U.S. troops from Iraq next month.

A White House statement welcomed the report, noting that “Bahrain is a long-standing partner of the United States,” and urged “the government and all parties to take steps that lead to respect for universal human rights and to meaningful reforms that meet the legitimate aspirations of all Bahrainis.”

The situation in Yemen, where the administration has said an al-Qaeda affiliate poses the most active terrorist threat to United States, is far more tenuous. Protesting young people took to the streets as news spread of the agreement signed Wednesday in Saudi Arabia by Saleh and a coalition of opposition political parties.

The demonstrators, who have occupied tent cities for months in the capital, Sanaa, and elsewhere in Yemen, have grown increasingly estranged from the opposition parties with which they had formed an anti-Saleh alliance. Amid violent clashes in Sanaa and the city of Taiz, thousands marched to protest provisions that give Saleh and his family immunity from prosecution.

“This is a betrayal to the martyrs of the revolution who sacrificed their blood for democracy and freedom of this country,” said Abdulnaser Kamali, a protester in Taiz. Youth activists called the agreement an arrangement between political elites, and they said they would not stop protesting or leave their camps until the power structure was completely toppled and those involved in killing more than 1,000 people since the uprising began in March were prosecuted.

Protesters called for massive demonstrations Thursday to denounce the agreement.

Meanwhile, troops loyal to the government remained in position, as did breakaway military forces and tribal militias supporting the opposition, and it was unclear how a stand-down would be managed under the agreement.

President Obama issued a statement calling events in Yemen “a historic transition” and urged “all parties to move immediately to implement the terms of the agreement.” A senior administration official, who spoke on the condition of anonymity after Obama’s statement, said that the administration was aware that the agreement “won’t solve all of Yemen’s problems immediately” but that it was “an important first step.”

Saleh had come under increasing pressure from domestic opponents and foreign allies to agree to a months-old plan, proposed by the six-nation Gulf Cooperation Council, to relinquish power to Vice President Abed Rabbo Mansour Hadi in exchange for immunity for himself and his family. Although Saleh had promised several times to sign and then balked at the last minute, recent weeks have brought increased factional fighting and threats of international sanctions from benefactors who feared that Yemen was on the verge of collapse into anarchy.

Despite indications the end was drawing near, many Yemenis appeared taken aback when Saleh appeared on live television Wednesday from Riyadh, seated next to Saudi King Abdullah and surrounded by diplomats from regional and Western governments whose assistance keeps Yemen’s economy afloat.

In a pointed speech to his Yemeni “brothers,” Abdullah called for “vigilance, realization of interests and identification of goals.” Quoting from the Koran, he warned that they should “fall into no disputes, lest ye lose heart and your power depart.”

Saleh, dressed in a dark business suit, smiled as he signed the document, the Associated Press reported from Riyadh.

Promising to “be cooperative” during the transition period, Saleh said the “disagreement for the last 10 months has had a big impact on Yemen in the realms of culture, development, politics, which led to a threat to national unity and destroyed what has been built in past years.”

Although Hadi has assumed presidential powers, Saleh will retain the title of president at least until a unity government is established under the vice president within 30 days. Elections are to be held in 90 days.

In New York, U.N. Secretary General Ban Ki-moon, whose special envoy to Yemen, Jamal Benomar, brokered the final stages of the deal, said Saleh told him in a telephone conversation Tuesday that he would “come to New York after signing the agreement to have medical treatment.” Saleh was severely injured in an attack on his palace in the summer and spent months recuperating in Saudi Arabia.

State Department spokesman Mark Toner said Wednesday that the United States had not confirmed any plans by Saleh to travel to this country.

Staff writer Alice Fordham in Beirut and special correspondent Mohammed al-Qadhi in Sanaa contributed to this report.