Syrian rebels have begun withdrawing from disputed neighborhoods in Damascus after reaching a deal with the government, according to both pro-government and pro-opposition sources, The agreement ends months of clashes and gives Syrian President Bashar al-Assad a new opportunity to secure the entire capital.

Several buses reportedly departed the northern district of Barzeh Monday carrying “tens” of militants, along with family members. More evacuations were set to follow in the coming days with the intention of clearing all armed factions from the area, the state-run Syrian Arab News Agency (SANA) reported. As part of the agreement to clear insurgents from Damascus, the Syrian military and its allies have agreed not to enter the neighborhood for six months, giving each resident the opportunity to pursue “reconciliation with the regime and settle his situation” or relocate to another part of the country of the individual’s own choosing, the Syrian Observatory for Human Rights, a monitoring group with close ties to the opposition, said Monday in a statement.

About 8,000 people, including 1,500 fighters and their relatives, were projected to leave Barzeh, according to Russia’s state-run Sputnik News. Talks were reportedly ongoing to reach a similar deal in the neighboring district of Qaboun, which also witnessed heavy fighting over the weekend. The neighborhood, part of rural, rebel-held Eastern Ghouta, was exempted from a recent truce because it contained fighters of Hayat Tahrir al-Sham, an affiliate of Al-Qaeda once known as Jabhat Fatah al-Sham and Nusra Front before that, Reuters quoted a Russian defense official as saying Friday.

Over the years, frequent clashes have occurred in the city’s outskirts between the military and rebels, including jihadi groups such as Ahrar al-Sham and Hayat Tahrir al-Sham. Rebels launched a renewed offensive against the Syrian army in March but were ultimately beaten back by a major counterattack. The latest evacuation deal was part of Assad’s efforts to reconcile and relocate fighters and civilians in pro-opposition areas and came days after a memorandum was signed by his international allies, Russia and Iran, and Turkey, which supports rebels, to create four de-escalation zones across the country for those fleeing the conflict that has killed hundreds of thousands and displaced millions more.

People who were evacuated from four besieged towns, as part of a reciprocal evacuation deal, travel to their respective destinations, with one convoy, right, going to rebel-held Idlib and another convoy, left, to government-held Aleppo, as they wait at a transit point in Al-Rashideen, Syria, on April 21. A similar deal was made to relocate fighters and civilians in the rebel-held neighborhood of Barzeh, Damascus, on May 8.AMMAR ABDULLAH/REUTERS

The memorandum, which has been approved by the Syrian Foreign Ministry and considered by the U.S., also sought to end the civil war between the Syrian military and certain armed opposition groups to focus on defeating jihadi rebels and the Islamic State militant group (ISIS). Syrian Foreign Minister Walid al-Moallem said Monday that reconciliation efforts in Barzeh, Qaboun and nearby Yarmouk Camp, a majority-Palestinian refugee district in which the Syrian military, jihadi groups, ISIS and various militias have battled for control, showed that factions were serious in their resolve to end the war.

“I think that the Syrian people have felt the importance and the effectiveness of these reconciliations,” Moallem told reporters, according to SANA.