|By Laila Bassam and Humeyra Pamuk

|By Laila Bassam and Humeyra Pamuk

|By Laila Bassam and Humeyra Pamuk

BEIRUT/ISTANBUL (Reuters) - A rapid advance by the Syrian army towards the Islamic State-held city of al-Bab risks sparking a confrontation with Turkey as Damascus seeks to stop its neighbor penetrating deeper into a strategically important area of northern Syria.

Northern Syria is one of the most complicated battlefields of the multi-sided Syrian war, with Islamic State now being fought there by the Syrian army, Turkey and its rebel allies, and an alliance of U.S.-backed Syrian militias.

In less than two weeks, Syrian army units have moved to within 6 km (4 miles) of al-Bab, a city that is also being targeted in a campaign waged by the Turkish military and its allies, groups fighting under the Free Syrian Army banner.

A source in the military alliance fighting in support of President Bashar al-Assad told Reuters on Wednesday the Syrian army aimed to reach al-Bab and was ready "to clash with the FSA fighting" alongside the Turkish army if necessary.

However, the source, a non-Syrian, said the main aim was to frustrate Turkey's ambitions and "to acquire a strong hand in the game unfolding on that front", rather than to provoke an all-out confrontation.

If a clash does occur, it would be the first time Syrian government forces have confronted the Turkish army on the ground in northern Syria since Turkey launched its operation in August.

Russia, Assad's most powerful ally, has carried out air strikes targeting Islamic State in the al-Bab area in support of both sides, underlining big shifts in the diplomatic landscape.

The non-Syrian military source spoke on condition of anonymity as he was not an official spokesman for the pro-Assad alliance.

The attack is led by the army's elite Tiger Force, with intelligence support from a command center in Aleppo staffed partly by Iranian advisors, the pro-Assad source said. The army campaign was receiving Russian air cover "when asked for".

Assad has been backed in the war by an array of Iranian-backed Shi'ite militias, including Hezbollah, and the Russian air force.

The Syrian Observatory for Human Rights, a UK-based group reporting on the war, said on Wednesday the Turkey-backed forces had made new advances to the southwest of al-Bab, calling this an effort to halt the gains by Syrian government forces.

Turkey launched its campaign in Syria, "Euphrates Shield", in order to secure its frontier from Islamic State and halt the advance of the powerful Kurdish YPG militia. Helping rebels to topple Assad is no longer seen as a priority for Ankara.

The Euphrates Shield campaign has carved out an effective buffer zone controlled by Turkey-backed rebel groups, obstructing the YPG's plans of linking up Kurdish controlled areas in northeastern and northwestern Syria.

Turkey sees the YPG as a terrorist group and a threat to its stability.

ERDOGAN: "WE SHOULD FINISH THE JOB"

The YPG and allied militia are receiving air support from a U.S.-led coalition because they are also fighting Islamic State, which has declared swathes of Syrian territory part of its "caliphate" that also stretches into Iraq.

Turkey has criticized the coalition for what it sees as insufficient air support for the ground offensive, while welcoming Russian air strikes coordinated with it in the al-Bab area this month.

"We are carrying out our efforts with the coalition forces, and Russia provides support from time to time as well," Turkish President Tayyip Erdogan said last week.

Al-Bab is located 40 km (25 miles) northeast of Aleppo, where Assad defeated rebels in December, his biggest victory of the war.

Assad has vowed to retake all of Syria, though large areas are out of his control and he is still heavily dependent on military support from his foreign allies.

Turkey has said progress by its rebel allies in al-Bab has been slowed by efforts to avoid civilian casualties. The Observatory has blamed Turkish bombardment for heavy civilian casualties, however.

Erdogan in November forecast that al-Bab would fall quickly, and said last week Islamic State was suffering "serious blood losses" there.

"We should finish the job in al-Bab swiftly and not go any deeper. The efforts are in this direction," he said.

Fierce Islamic State resistance including car bomb attacks have inflicted a heavy toll on Turkish troops. Five were killed and nine wounded on Jan. 20 near the city. Another Turkish soldier was killed on Sunday.

A senior Turkish security official told Reuters the campaign was not going slowly, but according to plan. "The circumstances change as we go deeper," the official said.

"We are not in a rush in al-Bab. There are many conditions to consider such as the weather, the fact this is new terrain for our troops. We’d rather go slowly but strongly with a minimum of casualties," the official said.

(Additional reporting by Nick Tattersall in Istanbul and Tom Perry in Beirut; Writing by Tom Perry; Editing by Sonya Hepinstall)