Updated

SANAA, Yemen -- The departure of Yemen's battle-wounded president for treatment in Saudi Arabia set off wild street celebrations Sunday in the capital, where crowds danced, sang and slaughtered cows in hopes that this spelled a victorious end to a more than three-month campaign to push their leader from power.

Behind the festive atmosphere, many feared Ali Abdullah Saleh, a masterful political survivor who has held power for nearly 33 years, will yet return -- or leave the country in ruins if he can't. Hanging in the balance was a country that even before the latest tumult was beset by deep poverty, malnutrition, tribal conflict and violence by an active al-Qaida franchise with international reach.

Saleh, who was taken overnight to a military hospital in the Saudi capital, Riyadh, underwent successful surgery on his chest to remove jagged pieces of wood that splintered from a mosque pulpit when his compound was hit by rockets on Friday, said medical officials and a Yemeni diplomat. They spoke on condition of anonymity because they did not have permission to release the information.

The stunning rocket attack, which the government first blamed on tribal fighters who in recent weeks turned against the president and later on al-Qaida, killed 11 bodyguards and seriously injured five senior officials worshipping just alongside Saleh.

While Saleh is away, Vice President Abed Rabbo Mansour Hadi is acting as temporary head of state, said the deputy information minister, Abdu al-Janadi. The minister said the president would return to assume his duties after his treatment, though experts on Yemeni affairs questioned whether a return is possible in the face of so much opposition.

"Saleh will come back. Saleh is in good health, and he may give up the authority one day but it has to be in a constitutional way," al-Janadi said. "Calm has returned. Coups have failed. ... We are not in Libya, and Saleh is not calling for civil war."

His sudden departure raised many questions, including whether his Saudi hosts would bless his return. The Saudis have backed Saleh and cooperated over the years in confronting al-Qaida and other threats, but they are now among those pressing him to give up power as part of a negotiated deal. Saudi Arabia has watched with concern the anti-government protests that have spread to other neighboring countries like Bahrain and is eager to contain the unrest on its doorstep.

The president's absence raised the specter of an even more violent power struggle between the armed tribesmen who have joined the opposition and loyalist military forces under the command of Saleh's son and other close relatives. Street battles between the sides have already pushed the political crisis to the brink of civil war.

In an attempt to cool the situation, the vice president offered through mediators to pull government forces back from the neighborhood of the capital where they've battled fighters loyal to Sheik Sadeq al-Ahmar, who heads Yemen's most powerful tribal confederation, the Hashid.

Al-Ahmar said in a statement he agreed to the deal, which requires his forces to leave the streets and government ministries they seized starting Monday.

Late Sunday, opposition members and ruling party officials said negotiations have begun based on a U.S.-backed Gulf Arab plan to end the crisis with Saleh's resignation. Saleh rejected that plan three times after agreeing to sign it. His departure could allow Yemen's powerful Gulf neighbors to push it forward. Details of how this would proceed remained unclear.

The two sides said Saleh was expected to remain in Saudi Arabia for two weeks, one for treatment and another for meetings, but it remained unclear if he will return to Yemen,

All spoke on condition of anonymity because negotiations were ongoing.

In the streets of the capital, Sanaa, joyful crowds celebrated what they hoped would be Saleh's permanent exit.

Crowds danced, sang and slaughtered a few cows in what demonstrators have dubbed Change Square, the epicenter of the nationwide protest movement since mid-February calling for Saleh to step down immediately. Some uniformed soldiers joined those dancing and singing patriotic songs and were hoisted on the shoulders of the crowd. Many in the jubilant crowd waved Yemeni flags, joyfully whistling and flashing the "V" for victory signs.

"Who would have believed that this people could have removed the tyrant?" said 30-year-old teacher Moufid al-Mutairi.

Women in black veils joined demonstrators carrying banners that hailed Saleh's departure. One read: "The oppressor is gone, but the people stay."

But there were also fears that the president would attempt a comeback or try to transfer power to his son Ahmed, who heads the Republican Guard and remains in Yemen. Some worried Saleh and his allies could even try to leave the country in ruins if they feel there is no way to stay in power.

"Saleh is never true to his word," said al-Mutairi, the teacher. "If the medical reports are true that his wounds are light, then he will for sure return. Our challenge now is to remove the rest of the regime."

"If he returns, it will be a disaster."

Yemen's unrest began as a peaceful protest movement that the government at times used brutal force to try to suppress, killing at least 166 people, according to Human Rights Watch. It transformed in the past two weeks into armed conflict after the president's forces attacked the home of a key tribal leader and one-time ally who threw his support behind the uprising. The fighting turned the streets of the capital into a war zone.

Other forces aligned against Saleh at the same time. There were high-level defections within his military, and Islamist fighters took over at least one town in the south in the past two weeks.

In Taiz, Yemen's second-largest city, dozens of gunmen attacked the presidential palace on Sunday, killing four soldiers in an attempt to storm the compound, according to military officials and witnesses. They said one of the attackers was also killed in the violence. The attackers belong to a group set up recently to avenge the killing of anti-regime protesters at the hands of Saleh's security forces.

Elsewhere in the south, gunman ambushed a military convoy, killing nine soldiers, officials said. They spoke on condition of anonymity because they were not authorized to talk to the media.

Saleh has been under intense pressure to step down from his powerful Gulf neighbors, who control a large share of the world's oil resources, and from longtime ally Washington. They all fear Yemen could be headed toward a failed state that will become a fertile ground for al-Qaida's most active franchise to operate and launch attacks abroad.

In a display of the kind of political maneuvering that has helped keep Saleh in power through numerous perils, he agreed three times to a U.S.-backed Gulf Arab proposal for ending the crisis only to back out at the last minute.

Now, Saleh's injuries and his treatment abroad provide him with what could turn out to be a face-saving solution to exit power.

"This is exactly what needed to happen," said Christopher Boucek, a Yemen expert with the Carnegie Endowment for International Peace. "He needed to leave in order to get past this political deadlock that has been cursing Yemen for the past few months."

Rick Nelson, a counterterrorism expert at the Center for Strategic and International Studies in Washington, said there is no chance of Saleh returning to Yemen and it's unlikely anyone linked to him can maintain power and control.

"I can't see any remnant of the Saleh government staying in place after this," Nelson said.

The fact that powerful members of Saleh's family have remained behind in Sanaa suggests vigorous attempts to hold power will be made.

Significantly, military officials said Hadi, the vice president, met late Saturday night in Sanaa with several members of Saleh's family, including his son and one-time heir apparent Ahmed, who commands the powerful Republican Guard. Others who attended the meeting included two of the president's nephews and two half brothers. All four head well-equipped and highly trained units that constitute the president's main power base in the military.