AMMAN, Jordan — It was little more than three years ago when rebels stormed the Nassib crossing on Syria’s southern border with Jordan. They rampaged through administrative buildings, ripping down the Syrian state flag and stomping on pictures of President Bashar Assad.

At the time, it was seen as yet another loss for a government on the verge of downfall, its battered troops in desperate retreat across the country.

On Friday, soldiers raised the state flag once again over Nassib, the state-run Syrian Arab News Agency reported, in the run-up to a full cease-fire and the surrender of the rebels’enclave in the southern province of Dara.

The victory further cements a Russian-engineered turnaround for Assad, which has handed him back control over what the French once called “La Syrie utile” — the string of major cities running from Aleppo down past Damascus and the country’s Mediterranean coastline.

It also clears the path for reopening the Nassib crossing, an important economic passageway whose loss had impoverished both Syria and Jordan.

SANA posted images on its Telegram channel on Saturday of soldiers flashing victory signs as they waved a flag over one building. Others showed stacks of ammunition and armored vehicles abandoned by the rebels.

It reported the Syrian army had also captured a number of border outposts east of Nassib and had already “shut down all illegal crossings and smuggling and supply routes for the terrorist groups,” employing the government’s routine term for the opposition.

Over the last two weeks, the skies over the south had been crowded with Russian and Syrian warplanes conducting hundreds of airstrikes on the rebels’ bastion, which at its zenith covered approximately two-thirds of Dara as well as the neighboring province of Quneitra under the control of Western-backed factions as well as jihadists from Al Qaeda and Islamic State.

The strikes were the usual prelude to the ground offensives that had seen other opposition enclaves fall over the last two years.

With some 320,000 already displaced since June 19 and lacking support from their Western and regional backers, the rebels announced on Friday that they had accepted a deal for a gradual handover of weapons and territory.

Most of the displaced had fled to Dara’s border with Jordan and to neighboring Quneitra province near the Israeli-occupied Golan Heights, whipped by desert winds and temperatures that could soar above 110 degrees Fahrenheit.

At least 15 people couldn’t endure the severe conditions; the U.N.’s coordination office for humanitarian affairs said they had died in areas close to the Jordanian border due to “scorpion bites, dehydration and diseases transmitted through contaminated water.”

Both Jordan and Israel had refused to let the refugees in, though they did allow aid to be delivered.

Some 20,000 civilians had begun returning to their homes Friday evening, according to the pro-opposition watchdog the Syrian Observatory for Human Rights.

Other rebel media activists said they had instead been transferred to the town of Busra al Sham under the stewardship of Shabab al Sunnah, an opposition faction that was now working with the government.

The agreement, SANA said, stipulates the rebels give up their heavy and medium weaponry.

Insurgents willing to lay down their arms and live under Assad's rule can join amnesty deals, and those who left their military service would be reintegrated into the army within six months.

As in previous iterations, those who refuse will be bused to rebel-held areas in the north.

All observation points along the border with Jordan would be handed back to government control, while state institutions and services would be restored. Residents could also return to their homes with Russian military police acting as guarantors of their safety.

But rebel spokesmen insisted government troops would not be allowed in the area, which would instead be secured by a local force composed of former rebel fighters working under the Russian police. The army, they said, would also withdraw from the more than 30 villages it had taken in the latest offensive.

At the time of writing, the army had not withdrawn and there were reports from a number of rebel activists of widespread looting by government forces.

The rebel surrender clears the way for a government offensive on Quneitra, a volatile region with jihadis bunkered in a corner of territory between Syria, Israel and Jordan.

Bulos is a special correspondent.

Twitter: @nabihbulos