Rebel fighters stand with their weapons on the outskirts of the northern Syrian town of al-Bab, Syria February 8, 2017. REUTERS/Khalil Ashawi

ANKARA (Reuters) - Turkey-backed rebels have largely taken control of Syria’s al-Bab from Islamic State militants, Turkish Prime Minister Binali Yildirim said on Tuesday, but a war monitoring group said the jihadists still controlled most of the town.

Syrian rebels, backed by Turkish special forces, tanks and warplanes, swept into northern Syria in August in an operation, dubbed “Euphrates Shield” by Ankara, to push Islamic State from Turkey’s border and stop the advance of Kurdish fighters.

“Al-Bab has been largely taken under control. Our aim is to prevent the opening of corridors from territories controlled by terrorist organizations to Turkey,” Yildirim said in a speech to lawmakers from his ruling AK Party in parliament.

However, the Britain-based Syrian Observatory for Human Rights said the militants remained in control of the northern Syrian town.

“Battles continue on the outskirts and entry points...of al-Bab between Islamic State (IS) and the Turkish forces and the Euphrates Shield factions, amid advances by the latter in the area,” the Observatory said.

“The organization (IS) still controls most of al-Bab,” it added.

The Turkey-backed rebels have been pressing a major offensive on al-Bab, 30 km (20 miles) south of the Turkish border, since November. The advance risks putting them in direct conflict with Syrian government forces who are closing in on the city from the south.

President Tayyip Erdogan and other Turkish leaders have been saying for weeks that the al-Bab offensive was nearing an end.

Further east along the border, Turkey’s security forces killed a member of the Syrian Kurdish YPG militia on Monday when they returned fire from Nusaybin into Syrian territory controlled by the group, the Turkish army said.