Gulf Arab states on Sunday suspended an effort to give Yemen’s embattled president a dignified exit after Ali Abdullah Saleh refused at the last minute to sign a U.S.-backed deal that would have given him immunity.

Saleh balked at signing the accord after a large mob of heavily armed supporters thronged the embassy of the United Arab Emirates in Sanaa, trapping the U.S. ambassador and other envoys inside for hours.

The events, five days after President Obama called on Saleh to “follow through on his commitment to transfer power,” underscored how volatile and violent a transition of power could become in a Middle East nation the United States sees as a vital ally in the battle against al-Qaeda.

Saleh has twice before reneged on promises to step down, but his refusal Sunday appeared to mark a breaking point in the diplomatic effort to end a three-month-old crisis that has plunged the country into chaos.

Diplomats arrived in the UAE Embassy on Sunday afternoon, expecting that Saleh and other senior Yemeni officials would sign the agreement. At approximately 4 p.m., a crowd of armed men gathered outside the embassy, proclaiming their support for the president and decrying the deal.

Two hours later, as concern for the safety of the diplomats grew, the Yemeni military dispatched helicopters to the compound to whisk out the diplomats. Some diplomats reportedly were carried out in the aircraft. U.S. Ambassador Gerald M. Feierstein left the embassy by car, a spokeswoman for the U.S. Embassy said Sunday night.

Feierstein and the other ambassadors met later at the presidential palace, where members of Saleh’s General People’s Congress party signed the agreement as Saleh watched, according to the official Yemen News Agency. Then, to the dismay of the diplomats, the president indicated he had some reservations about the deal, and refused to sign.

Yemen experts said the protests and their aftermath were the latest in a series of crises orchestrated by Saleh as part of his ongoing effort to retain his grip on power.

“This crisis was manufactured in a way so that Saleh could come in and solve it and hope he could distract everyone from the issue at hand,” Gregory Johnsen, a Yemen expert at Princeton University, said in telephone interview.

Johnsen said reporting from the region indicates that Saleh henchmen had been directing the protests that converged on the UAE Embassy and have been seeking to exploit divisions among factions of the protest movement in Yemen for months.

Saleh believes that the longer he can draw out the transition, the better his chances of manipulating the process or subverting it altogether, Johnsen said. Yemen’s history, and the fractious nature of the protest movement, suggest that Saleh may still prevail. The opposition is united by disdain for Saleh and frustration with his rule, but little else.

Late in the day, Saleh appeared on state television to say he had refused because leaders of the country’s political opposition, who had signed the deal the day before, had not done so in his presence.

He also presided over an emergency meeting with his security chiefs, during which he charged that members of the country’s political opposition were “escalating the crisis and harming the nation’s interest in order to achieve its coup on democracy,” the country’s news agency reported. And in a televised speech, Saleh said the opposition would be responsible “if the country goes to civil war.”

On Sunday night, Saleh telephoned Saudi Arabia’s King Abdullah and other Gulf heads of state to explain his decision, the news agency reported. The Gulf Cooperation Council, a coalition of oil rich states that include Saudi Arabia and the UAE, brokered the deal in recent weeks. The agreement stipulated that Saleh would not face prosecution as long as he surrendered power within 30 days.

Saleh, who has ruled Yemen for 32 years, has faced mounting protests this year, alongside other autocrats in the Arab world. He has tolerated little dissent in recent years as he has tackled an array of problems. The government has been threatened by a Shiite uprising in the north, a separatist movement in the south and al-Qaeda cells that have used the country to plot attacks on the West.

Diplomats and observers have grown increasingly skeptical of his willingness to surrender power. Saleh’s brinksmanship carries substantial risks for the region, but also the United States, which depends on cooperation with the Yemeni government in pursuing al-Qaeda operatives in the country. Al-Qaeda in the Arabian Peninsula, as the Yemen-based offshoot is known, has been linked to a series of plots, including the attempted bombing of a Detroit-bound airliner in 2009, and is regarded by U.S. counterterrorism officials as the most pressing threat to the United States.

Yemen’s security forces have largely abandoned their efforts against Al-Qaeda as the crisis in their country unfolds.

Since protesters first took to the streets in Sanaa to decry corruption and call for democratic freedoms, Saleh has used the country’s armed forces to thwart the uprising. More than 170 protesters have been killed, according to opposition groups.

Miller reported from Washington.