Syria (search) ended its 29-year military domination of Lebanon (search) on Tuesday as soldiers flashing victory signs completed a withdrawal spurred by intense international pressure and massive Lebanese street protests against a force that once reached 40,000.

At a farewell ceremony at Rayak, a few miles from the shared border, a Syrian commander told Lebanese troops: "Brothers in arms, so long," and the Lebanese soldiers responded, "So long."

A Lebanese commander then addressed the Syrians, saying: "Brothers in arms, thank you for your sacrifices." His soldiers repeated, "Thank you for your sacrifices."

About 250 Syrian soldiers in red berets and camouflage, the last troops to leave Lebanon, shouted: "We sacrifice our blood and our souls for you, oh Bashar!" in a reference to Syrian President Bashar Assad (search).

After the ceremony, the Syrian intelligence chief in Lebanon, Maj. Gen. Rustom Ghazali joined 10 carloads of intelligence agents and the remaining 250 soldiers in crossing the border, followed by scores of troops guarding the road to the ceremony.

At the crossing, about 25 Lebanese civilians saluted Ghazali, who got out of his car and accepted a poster from a Lebanese man that said: "Thank you Syria."

On the Syrian side, hundreds waved flags and danced in the streets at the crossing point of Jedeidit Yabous. They climbed on buses carrying the returning troops and chanted, "God, Syria and Bashar only!"

"I'm so happy they're back," said Noura Sabbagh, 16, who was carrying a red rose that she hoped to give to a soldier.

The Syrians entered Lebanon in 1976, ostensibly as peacekeepers in Lebanon's year-old civil war. After the war ended in 1990, about 40,000 Syrian troops remained, giving Damascus the decisive say in Lebanese politics.

But international pressure and Lebanese anger over the Feb. 14 assassination of former premier Rafik Hariri (search) in a Beirut car bombing helped turn the tide against Syria's presence and Damascus pulled out its remaining 14,000 troops during the past two months.

The opposition blamed Hariri's murder on the Lebanese government and its Syrian backers, accusations both governments deny. Huge "Syria Out" demonstrations in Beirut brought down the pro-Syrian government, and U.N. and U.S. pressure intensified on Damascus until it withdrew its army.

Lebanon's new Prime Minister, Najib Mikati, is a compromise candidate between the pro-Syrian and anti-Syrian political camps. The Cabinet, whose sole purpose is to prepare the country for elections next month, went to Parliament on Tuesday seeking a vote of confidence.

Shaaban al-Ajami, the mayor of Lebanese border village of Majdal Anjar, said he was happy to see the Syrians leave: "I feel like someone who was suffocated and jailed and has finally emerged from jail."

With the Syrians leaving, its Lebanese allies in the security services also were collapsing. Maj. Gen. Jamil Sayyed — often described as the enforcer of Syrian policy — announced his resignation Monday, and another top security commander left the country with his family.

Gen. Ali Habib, Syria's chief of staff, said in a speech during the departure ceremony that Syria's president had decided to pull out his troops after the Lebanese army had been "rebuilt on sound national foundations and became capable of protecting the state."

Habib said Syria had no "ambitions in Lebanon, except to protect it." By withdrawing, Habib said, Syria will have "fulfilled all its obligations toward" U.N. Resolution 1559, which was passed by the Security Council last year and called on Damascus to pull out of Lebanon.

U.N. Secretary-General Kofi Annan (search) has dispatched a team led by Senegalese Brig. Gen. Mouhamadou Kandji to verify the withdrawal.

Habib stressed that the withdrawal does not mean an end to Syrian-Lebanese ties.

He then took a a swipe at the United States, saying, "Anyone who thinks that the history of people can be eliminated by statements made by this or that state is mistaken."

Lebanese army commander Michel Suleiman lauded the role of Syria's military in Lebanon, crediting it with rebuilding the army, maintaining peace among the country's 17 sects and ending the 1975-1990 civil war.

He pledged continued cooperation between the two countries in several fields, including the fight on terror and opposition to Israel.

"Together we shall always remain brothers in arms in the face of the Israeli enemy," Suleiman said.