Syrian rebels backed by the Turkish military have captured the outskirts of the ISIL-held city of al-Bab in northern Syria, the Turkish government and rebel sources said.

The advance threatens an important ISIL stronghold, whose fall would deepen Turkish influence in an area of northern Syria where it has created a de facto buffer zone.

The Turkish military said in a statement that 58 ISIL fighters had been killed in air raids, artillery fire, and clashes. Two Turkish soldiers were killed and 15 slightly wounded.

Syrian government forces also advanced on al-Bab from the south on Wednesday, bringing them into close proximity with their Turkish and rebel enemies in one of the most complex battlefields of the six-year-old conflict.

But Turkey said international coordination was under way to prevent clashes with the Syrian forces.

"The al-Bab operation must be completed immediately in the period ahead ... In recent days our special forces and the Free Syrian Army [rebels] have made serious progress," Turkish Foreign Minister Mevlut Cavusoglu told a news conference.

READ MORE: ISIL fighters 'besieged' in Syria's al-Bab in Aleppo

In a sign of Turkish momentum and confidence, the government said its next target would be the Syrian city of Raqqa, de facto capital of the Islamic State of Iraq and the Levant group, which is also under attack in its Iraqi stronghold of Mosul.

Al-Bab has been a major target of a Turkish offensive launched in northern Syria last August to drive ISIL away from the border and prevent further gains by US-backed Kurdish militia that are also fighting the group. The city is just 30km from the Turkish border.

A Free Syrian Army rebel commander, speaking to the Reuters news agency from the southeastern outskirts of al-Bab, said Syrian government jets and helicopters were visible to the west of his position, adding there was now an "indirect frontline" between the sides.

But an official in a military alliance backing Syrian President Bashar al-Assad said the city was being left to Turkish control, in what appeared to be part of a deal with Russia, Assad's most powerful ally.

Turkish Prime Minister Binali Yildirim said clashes with the Syrian forces had been avoided.

"As a result of coordination between coalition forces, the Turkish air force and Russia, necessary measures are being taken to prevent any unpleasant incidents or clashes," Yildirim said.

Assad has been backed in the war by the Russian air force and an array of Iranian-backed Shi'ite militias. The Syrian army advance towards al-Bab is aimed at preventing deeper Turkish advances and safeguarding the city of Aleppo, 50km to the southwest.

'Progress is fast'

A Syrian rebel fighter reached by Reuters said he was speaking from inside al-Bab where ISIL lines were "collapsing".

"Praise God, the progress is fast," he said. "The operation is continuing."

The Syrian Observatory for Human Rights, a UK-based organisation that uses a network of contacts in Syria to monitor the war, said it was not yet clear if ISIL was on the ropes. It said at least six people had been killed and 12 more wounded in the latest shelling there.

ISIL is being fought by three separate military alliances in northern Syria, including the US-backed Syrian Democratic Forces, which incorporate the Kurdish YPG militia.

US support for the YPG has angered Turkey, which views it as an extension of a Kurdish militia that is waging a rebellion in Turkey.

Turkish sources said President Tayyip Erdogan and US President Donald Trump agreed in a phone call overnight to act jointly against ISIL in al-Bab and Raqqa.

The White House said in a statement that Trump spoke about the two countries' "shared commitment to combating terrorism in all its forms".