A boy walks along a damaged street at the city of Douma in Damascus, Syria, April 16, 2018. REUTERS/Omar Sanadiki

BEIRUT (Reuters) - Syrian rebels began pulling out of an enclave they have surrendered in south Damascus on Thursday, but a few fighters in another besieged area near Homs shelled government areas after their groups agreed to quit.

The enclaves in south Damascus and near Homs are the only two besieged areas still held by rebels, though they still control large tracts of northwest and southwest Syria, lying along its international borders, which are not surrounded by the army.

Syrian President Bashar al-Assad has focused on dislodging rebels from their remaining besieged pockets since driving them from eastern Ghouta last month after a fierce offensive.

Syrian state television showed footage of buses arriving at Beit Sahm, driving through narrow streets surrounded by soldiers and with concrete buildings above showing scars of war.

It later reported that the first batch of buses had departed, carrying fighters and their families from the area.

Some 5,000 fighters and their family members are expected to leave Beit Sahm, Babila and Yalda neighborhoods for the opposition areas in northern Syria, it reported, following an earlier group which left the enclave on Monday.

Islamic State fighters holding another part of the same enclave are still fighting after weeks of intense bombardment in the area of al-Hajar al-Aswad and Yarmouk Palestinian refugee camp.

On Wednesday, insurgents in the biggest of the remaining besieged areas, located between the cities of Hama and Homs around the towns of Rastan, Talbiseh and Houla, also agreed to surrender.

However, a small number of them rejected the deal and shelled government areas late on Wednesday and early on Thursday, the Syrian Observatory for Human Rights war monitor and two local sources said.