Thousands of people who were recently displaced by violence in northwest Syria have returned home following a Russia-Turkey deal that averted a government offensive on the last major rebel stronghold, Syrian opposition activists said Wednesday.

The United Nations said that in the first 12 days of September, over 38,000 people were internally displaced by an intense government aerial bombing campaign in Idlib and neighboring provinces. Most of them headed toward the border with Turkey, packing already overcrowded camps there, the U.N. Office for the Coordination of Humanitarian Affairs said.

It said over 4,500 are estimated to have spontaneously returned to their homes shortly afterward when government bombardment stopped.

The Britain-based Syrian Observatory for Human Rights said that some 7,000 people have returned to their towns and villages since Monday when Russia and Turkey announced the deal.

Syria-based opposition activist Yazan Mohammed said the flow of people back to their homes started days before Monday's deal was announced between Russia and Turkey as residents were expecting it.

The demilitarized zone will be established by Oct. 15 and be 15-20 kilometers (9-12 miles) deep, with troops from Russia and NATO-member Turkey conducting coordinated patrols. Turkey's Foreign Minister Mevlut Cavusoglu said the agreement would allow civilians and Turkey-backed anti-government rebels to remain in the demilitarized zone and "retain light arms."

Idlib is home to some of the government's staunchest opponents, including civilians and insurgents.

Insurgent groups include al-Qaida-linked Hayat Tahrir al-Sham — or Levant Liberation Committee — the Turkistan Islamic Party and Horas al-Din, or Guardians of Religion.

Speaking against the deal, some in Idlib said they feared it would pave the way for a massive attack.

The Observatory said some hard-line groups including Guardians of Religion and the Soldiers of God, rejected the deal and said they will not withdraw from the demilitarized zone. The groups warned that they will fight any side that will try to disarm or remove them from the planned demilitarized zone, the Observatory said.