Carrying their rifles and small bags of belongings, hundreds of exhausted Syrian rebels withdrew Wednesday from their last remaining strongholds in the heart of Homs, surrendering to President Bashar Assad a bloodstained city that was once the center of the revolt against him.

For Assad, it is a powerful victory ahead of presidential elections. For the rebels, the dramatic exit after two years of enduring grueling assaults and siege captures their sense of abandonment amid world reluctance to help shift the balance of power on the ground.

"We ate grass and leaves until there was nothing left for us to eat," said opposition activist Abu Yassin al-Homsi, who was preparing to leave with the rebels later Wednesday. "We kept urging the international community to lift the siege but there was no response," he added.

The exit of some 1,200 fighters and civilians marks a de-facto end of the rebellion in the war shattered city, which was one of the first places to rise up against Assad's rule, earning its nickname as "the capital of the revolution."

Gaining virtually full control of Syria's third largest city is a major win for Assad on multiple levels. Militarily, it solidifies the government hold on a swath of territory in central Syria, linking the capital Damascus with government strongholds along the coast and giving a staging ground to advance against rebel territory further north.

Politically, gains on the ground boost Assad's hold on power as he seeks to add a further claim of legitimacy in presidential elections set for June 3, which Western powers and the opposition have dismissed as a farce.

"For those who want to believe that the regime is winning, it's a powerful symbolic confirmation of that," said Peter Harling, a Middle East expert at the International Crisis Group think tank. "But it really is about what the regime has to offer beyond years of such symbolic military victories," he added.

"If you take a broader perspective, I think it's an indication that this conflict is going to take years."

By early evening Wednesday, some 600 fighters had boarded buses that departed from a police command center on the edge of Homs' rebel-held areas, heading north to rebel held towns of Talbiseh and al-Dar al-Kabira, opposition activists said. Many of the rebels were wounded, and it was unclear how many civilians were among them.

According to the deal, each fighter was allowed to carry his rifle and a bag of belongings with him. One rocket propelled grenade launcher and a machinegun were also allowed on each bus.

"We shall return to Homs!" some of the evacuees chanted as they arrived in al-Dar al-Kabria and residents rushed to give them fruits and water, according to Mohammed Rahal, an activist who was there to receive them. He said some of the fighters were "so weak they needed assistance to walk."

Videos of the evacuation posted online by activists captured the massive destruction inflicted on Homs from months of bombardment. Buildings were shattered, some with chunks of concrete dangling from twisted rebar, others with upper floors collapsed. Rebels with bags of belongings — some with their faces covered — boarded green buses as black-uniformed police oversaw the process. At least one U.N.-marked vehicle was parked nearby. Then the buses trundled down a battered road past the wrecked city landscape.

The videos appeared genuine and matched the AP's reporting on the evacuation.

It was a bitter moment for the exhausted rebels, who had pledged to fight to the end in 13 neighborhoods in and around the historic quarters of Homs where they had been holed up under siege for more than a year.

Homs, with a prewar population of 1.2 million was among the first to rise up in early 2011 with waves of exuberant anti-Assad protests. As Syria's conflict turned into outright civil war, rebels took control of nearly 70 percent of the city, whose population represents Syria's mix — with a largely pro-rebel Sunni majority and a pro-Assad Alawite minority, along with Christians and other religious and ethnic minorities.

The city quickly came under a series of crushing government offensives, turning into a battleground that left entire blocks and much of its historic quarters in ruins. Thousands of people were killed and almost all its residents fled. Tit-for-tat sectarian killings rose, reflecting the increasingly religious dimension of the conflict nationwide.

Rebels were slowly pushed back. For well over a year, government forces have been besieging rebels in around a dozen districts around its ancient bazaars. With food and medicine short, a first major group — around 1,400 people, including fighters and residents — evacuated earlier this year in a U.N.-mediated operation.

The last die-hards, including many from the al-Qaida-linked Nusra Front and other Islamic factions, held out for weeks. But they agreed Friday to the cease-fire deal, which includes the release of captives held by rebels in Aleppo and Latakia provinces, and the easing of a rebel siege on two pro-government Shiite towns in Aleppo province in return for the safe passage out of Homs on Wednesday.

The rebels, however, will retain one toe-hold in Homs. Fighters in the heavily populated Waer district, just outside Homs' Old City, have so far refused to join the evacuation. Some activists said negotiations were underway for a similar deal there.

The evacuation caps a series of successes for Assad's forces. Backed by fighters from the Lebanese Shiite militant group Hezbollah, pro-government troops recently seized key territory in rugged mountains near the border with Lebanon and around the capital Damascus.

The government has control of almost all cities, as well as the recently won Qalamoun region stretching north of Damascus to the Lebanese border and towardHoms. It also has a nearly unquestioned grip on the mountainous Mediterranean coastal region, the heartland of Assad's Alawite minority.

Still, Assad has lost huge territory to the opposition. Rebels hold northern Aleppo province, much of neighboring Idlib province and the territory along the Turkish border, as well as the Raqqa region in the east — and Aleppo city, the country's largest city and former commercial hub, is carved up into rebel-held and government-held halves. Much of the rural areas in the south are highly contested, and rebels hold a number of surburbs ringing Damascus.

Syrian officials say the June 3 elections will only be held in government-controlled territory and Western powers have dismissed the vote as a sham, saying it will effectively spell the death knell of any peace talks in the foreseeable future.

Get the Monitor Stories you care about delivered to your inbox. By signing up, you agree to our Privacy Policy

"The regime has reached a point where it's happy to focus on this military challenge because it helps it shun other more political moves," said Harling. The military conflict is "not life-threatening for the regime" and instead has become a "source of legitimacy" among Assad supporters — "It's a resource."

AP writers Albert Aji in Damascus and Ryan Lucas in Beirut contributed to this report.