Turkey says it has struck back against Syrian military targets after at least five of its soldiers and three civilians attached to the Turkish army were killed by Syrian government forces in the war-torn country's Idlib region.

Turkey's Defence Ministry said on Monday that seven of its troops were also wounded in shelling by Syrian government forces in the last rebel-held stronghold in Syria.

More:

The ministry said its forces, who were sent in as reinforcements, came under fire despite advance notification of their coordinates. But Russia, a major backer of Syrian President Bashar al-Assad, said later on Monday the Turkish troops were shot overnight due to a lack of information.

The developments are likely to further increase tensions between Turkey and the Syrian government as such direct clashes have been rare. They could also cause friction between Moscow and Ankara, which have sought to coordinate their actions in Syria.

Speaking to reporters before departing for Ukraine, Turkey's President Recep Tayyip Erdogan said Ankara's response involved fighter jets and artillery fire against Syrian military targets.

Erdogan said the counterfire killed between 30 and 35 Syrian troops.

"Those who test Turkey's determination with such vile attacks will understand their mistake," he said, adding that Moscow was told that Ankara would not stand for any "situation where we are prevented" from responding to Syrian assaults.

"It is not possible for us to remain silent when our soldiers are being martyred," Erdogan said.

At a news conference in Kyiv, he also said that nearly one million people were moving towards the Turkish border because of the Syrian goverment offensive on Idlib.

The exchange occurred near the Syrian flashpoint town of Saraqeb, according to the Britain-based Syrian Observatory for Human Rights, a war monitoring group. It added that Turkish troops shelled Syrian army positions in three provinces, killing eight soldiers in Idlib, three in Latakia province and two in the Hama region.

However, Syria's state news agency SANA said government forces captured two new villages on the way to Saraqeb. It added that as Syrian troops were chasing fighters, four Turkish soldiers were killed and nine wounded, triggering a Turkish retaliation - but it claimed there were no casualties among Syrian troops.

Meanwhile, the Russian military, which controls the airspace over Idlib province, said the Turkish aircraft never entered Syria's airspace during Monday's attack. Kremlin spokesman Dmitry Peskov said the Russian military remains in "constant contact" with Turkish counterparts in Syria.

The developments came a day after a large Turkish military convoy moved into the area amid a new Syrian government offensive backed by Russian jets, raising the spectre of a new refugee crisis.

The Turkish military convoy consisted of dozens of armoured vehicles, fuel tanker trucks and flatbed trucks carrying tanks and armoured personnel carriers.

Turkey has set up 12 military posts around Idlib in line with a 2018 deal between Russia, Iran and Turkey for de-escalation zones in the region.

Displaced by violence

Idlib province is home to about three million people, many of them displaced from other parts of Syria in earlier bouts of violence.

According to the United Nations, almost 390,000 people, mainly women and children, have fled their homes in northwest Syria since December 1 last year.

Turkey hosts more than 3.5 million Syrian refugees and is wary of a fresh influx.

The Syrian government and its main ally, Russia, maintain the military operation in Idlib is aimed at driving out "terrorists" from the region, in accordance with the 2018 de-escalation agreement.

The Hay'et Tahrir al-Sham armed group, a former al-Qaeda affiliate that is considered by Russia and Turkey a "terrorist" organisation, controls a large portion of Idlib.

Russia and Turkey cooperated late last year in establishing the borders of a so-called safe zone in a separate region in northeast Syria, following an operation against Kurdish fighters dubbed "terrorists" by Ankara.