BEIRUT (Reuters) - Dozens of hostages held by militants in northern Syria reached army lines on Tuesday, launching a deal for insurgents to quit an enclave south of Damascus, state media and a monitor said.

Slideshow ( 7 images )

State news agency SANA said 42 people were freed in the first step of the agreement, arriving in government territory at a crossing near Aleppo city.

Women, children, and men including some soldiers wept and hugged on the bus, live on state TV. Islamist rebels had kidnapped the people in a village in rural Idlib as they swept into the province three years ago.

South of Damascus, buses shuttled 200 fighters and relatives out of the Yarmouk enclave under the swap between the government and insurgents, the Syrian Observatory for Human Rights said.

The fleet arrived at the same crossing near Aleppo in the early hours, the UK-based war monitoring group said. The fighters from Hayat Tahrir al-Sham, formerly linked to al-Qaeda, would go to Idlib in the northwest near the Turkish border.

President Bashar al-Assad’s military and its allies have pushed to crush the last insurgent footholds around the capital Damascus through a string of offensives and withdrawal deals.

The pocket south of Damascus includes zones held by Islamic State and others by rebel factions, which have fought each other. It has been the focus of intense fighting since the Syrian army recaptured eastern Ghouta last month with Russian and Iranian help.

Bombing has left parts of the once-teeming Yarmouk Palestinian refugee camp in ruins, and the United Nations raised warnings over the fate of civilians still stuck there.

The evacuation deal for Tahrir al-Sham to surrender also includes allowing people to leave two pro-government Shi’ite villages, which the insurgents have encircled in Idlib.

State media said ambulances carried some critically ill patients out of the villages, al-Foua and Kefraya, on Tuesday morning in the first step of the agreement.