FILE - This June 30, 2018 file photo provided by Nabaa Media, a Syrian opposition media outlet, shows people in their vehicles who fled from Daraa, gathering near the Syria-Jordan border. Syrian activists and state media said Thursday, July 12, 2018 that the rebels have agreed to surrender Daraa, the first city to revolt against President Bashar Assad with Arab Spring-inspired protests seven years ago, to government forces. (Nabaa Media, via AP, File)

FILE - This Thursday, July 5, 2018 file photo provided by Nabaa Media, a Syrian opposition media outlet, shows smoke rising over buildings that were hit by Syrian government forces bombardment, in Daraa province, southern Syria. Syrian activists and state media said Thursday, July 12, 2018 that the rebels have agreed to surrender Daraa, the first city to revolt against President Bashar Assad with Arab Spring-inspired protests seven years ago, to government forces. (Nabaa Media via AP, File)

BEIRUT (AP) — For the first time in more than seven years, the Syrian government raised its flag Thursday over Daraa, the first city to revolt against President Bashar Assad in 2011 and plunge the country into its calamitous civil war.

The display is laden with symbolism as the government moves to stamp out the last of the uprising against the 52-year-old Assad who has ruled with an iron fist over Syria for 18 years. His father Hafez Assad was president for three decades before him.

Officials accompanied by state media crews hoisted the two-star flag over the rubble of the city's main square, allowing it to wave in sight of the shell of the Omari Mosque where protesters first gathered in demonstrations demanding reforms then Assad's ouster in the spring of 2011.

The mosque has since been destroyed in the government's brutal crackdown against the city, which ranged from alleged torturing of dissidents to shelling the city with tanks and planes.

With control over Daraa, government forces can now focus on clearing the last pockets of the opposition and, separately, the Islamic State group from the frontier at the Golan Heights, which Israel seized from Syria in a 1967 war.

The corner of southwest Syria is an important corridor for trade between Syria and Jordan, and onward to the oil-rich Gulf states. But most of the important fighting against the revolt has already been concluded in shattering battles farther to the north for the main cities of Damascus, Aleppo, and Homs, and territories in between.

Some 400,000 people have been killed in seven years of war.

Protests in Daraa in 2011 against the government's mistreatment of teenage detainees ignited a national revolt against decades of authoritarian rule.

Ahmad Masalmeh, a media activist formerly based in Daraa, said fighters in the city had accepted an offer of amnesty from the government, and let back in the state institutions and symbols of Assad's rule.

Rebels refusing to accept the deal will be exiled with their families to other rebel-held parts of the country.

The agreement follows a template imposed by the government and its Russian and Iranian backers that has forced hundreds of thousands of Syrians, including media activists, army defectors, and draft dodgers and their family members to give up their homes to lift the sieges against their cities.

Human rights monitors say the arrangements amount to a program of political and demographic engineering in Syria to secure Assad's rule.

Government forces launched an offensive to recapture southwest Syria and the areas neighboring Jordan and Israel on June 19. They surrounded Daraa's rebel-held quarters on Monday. Dozens have been killed in the campaign, including 162 civilians, according to Rami Abdurrahman, director of the Syrian Observatory for Human Rights — among them women and children.

U.N. Secretary-General Antonio Guterres told reporters at a news conference that the world body had tried "to prevent a bloodbath" in the region.

Late last month, Guterres had called for an immediate end to military operations and a return to cease-fire arrangements agreed to by Russia, the United States and Jordan.

"I think that our action was useful in that regard," he said. "But again the objective must be and remains entirely for us a political solution."

Mohamad al-Hanous, Daraa's governor, said government forces were in control of 80 percent of the city, according to the government-linked Central Military Media outlet, while Syrian state media reported late Wednesday that rebels in Daraa had agreed to surrender their heavy and medium weapons.

Under the terms of the agreement, Russia will deploy military police to maintain order in Daraa and facilitate the transition back to government rule, said a media activist inside who asked for anonymity out of concern for his safety.

Russian mediators are warning fighters and civilians against leaving Daraa for Idlib, the northwest Syrian province where over a million displaced Syrians are living in dire conditions and exposed to government airstrikes and the possibility of a future offensive.

"Idlib is a crematory," the activist said Russian mediators warned him.

Humanitarian groups say more than 300,000 people have been displaced by the government's southern offensive, moving toward the Jordanian border and to Quneitra, a province that borders Israel.

Israel and Jordan's borders are closed to refugees, and the aid group Oxfam said Thursday it was unable to deliver enough aid across the Jordan border to meet the needs of the internally displaced residents.

The circumstances are especially perilous for journalists and media activists, who say they fear for their lives if they are captured by government troops.

The Committee to Protect Journalists said Wednesday at least 70 journalists were trapped in southwest Syria and required protection.

Syria is one of the most dangerous countries in the world for journalists, according to CPJ. At least 120 journalists have been killed in the country in relation to their work since the conflict began in 2011, according to CPJ research. At the time of CPJ's most recent prison census, at least seven journalists were in Syrian state prisons while many others are missing.

Masalmeh, the media activist, said he was smuggled out of southwest Syria to Jordan four days ago, leaving his parents and extended family in Daraa.