BEIRUT — More than two dozen Turkish soldiers were killed in an air strike by Syrian government forces in northeast Syria, a Turkish official said Friday.

The deaths mark a serious escalation in the direct conflict between Turkish and Russia-backed Syrian forces that has been waged since early February.

Rahmi Dogan, the governor of Turkey’s Hatay province bordering Syria’s Idlib region, said 29 troops were killed and others were seriously wounded in the attack late Thursday.

In addition to three Turkish soldiers killed in Idlib earlier Thursday, the casualties mark the largest death toll for Turkey in a single day since Ankara first intervened in Syria in 2016. At least 50 have now been killed in Idlib since the start of February.

Turkish President Recep Tayyip Erdogan was holding an emergency security meeting in Ankara, state-run Anadolu news agency reported. Meanwhile Turkish Foreign Minister Mevult Cavusoglu spoke to NATO Secretary General Jens Stoltenberg by telephone.

Erdogan’s spokesman Ibrahim Kalin, who plays a senior role in foreign affairs, also spoke to U.S. National Security Advisor Robert O’Brien.

The air strike came after a Russian delegation spent two days in Ankara for talks with Turkish officials on the situation in Idlib, where a Syrian government offensive has sent hundreds of thousands of civilians fleeing towards the Turkish border.

The offensive has also engulfed many of the 12 military observation posts Turkey has in Idlib.

Fahrettin Altun, Erdogan’s communications director, said “all known” Syrian government targets were under attack by Turkish air and land forces in response to the deaths.

Turkish television news channels aired black-and-white footage of air strikes on Syrian targets.

The Syrian Observatory for Human Rights said at least 34 Turkish soldiers were killed in air strikes on Idlib on Thursday. It said the attacks occurred in an area between the villages of al-Bara and Baliun near the Jabal al-Zawiya region in the southern Idlib countryside. The Britain-based Observatory monitors the Syria war through a network of activists on the ground.

The air strike came after Turkey-backed Syrian opposition fighters retook a strategic northwestern town from government forces on Thursday, opposition activists said, cutting a key highway just days after the government reopened it for the first time since 2012.

Despite losing the town of Saraqeb, Syrian President Bashar Assad’s forces made major gains to the south. Assad now controls almost the entire southern part of Idlib province after capturing more than 20 villages Thursday, state media and opposition activists said. It’s part of a weekslong campaign backed by Russian air power into Syria’s last rebel stronghold.

Violence in Idlib province also left three more Turkish soldiers dead, according to Turkey’s President Recep Tayyip Erdogan, raising the number of Turkish troops killed in Syria this month to 21. Thousands of Turkish soldiers are deployed inside rebel-controlled areas of Idlib province, which is dominated by al-Qaida-linked militants.

Turkey’s U.N. Ambassador Feridun Sinirlioglu told the Security Council on Thursday that Turkey was committed to upholding a fragile cease-fire agreement that Turkey and Russia reached on Idlib in 2018.

The Syrian government troops’ “deliberate attacks on our forces has been a turning point. We are now determined more than ever to preserve Idlib’s de-escalation status.”

Syria’s Defense Ministry said insurgents were using Turkey-supplied portable surface-to-air missiles to attack Syrian and Russian aircraft. It did not elaborate. Earlier this month, Turkish-backed opposition fighters shot down two helicopter gunships belonging to the Syrian military.

The Britain-based Syrian Observatory for Human Rights, an opposition war monitoring group, said opposition fighters seized the town of Saraqeb after intense bombardment by Turkish troops. Turkey and Russia support opposite sides in Syria’s brutal civil war, with Ankara backing the opposition and Moscow backing Assad.

Saraqeb’s loss is a big setback for Assad. It sits on the strategic M5 highway linking the northern city of Aleppo with the capital, Damascus. Syrian troops recaptured the last rebel-controlled section of the M5 earlier this month. Officials had hailed the reopening of the motorway as a major victory in the nine-year conflict.

The Syrian government’s military campaign to recapture Idlib province has triggered a humanitarian catastrophe and the war’s largest single wave of displacement. According to the United Nations, almost 950,000 civilians have been displaced since early December, and more than 300 have been killed. Most have fled farther north to safer areas near the Turkish border, overwhelming camps already crowded with refugees in cold winter weather.

From inside Saraqeb, activist Taher al-Omar said the town is now under opposition control. He posted a video with a fighter saying the government forces “ran away like rats.”

The Observatory said more than 60 fighters were killed on both sides since Wednesday, adding that government forces launched a counteroffensive later Thursday under the cover of Russian airstrikes to try retake the town.

Syrian state media reported intense clashes near Saraqeb, saying insurgents sent suicide car bombs and that Turkish forces bombarded the area. It said a small group of insurgents reached the highway to score a “propaganda stunt,” adding that “Syrian troops are dealing with them.”

State TV later Thursday confirmed that insurgents have cut the highway, adding that fighting is ongoing in the area.

The Observatory also reported on the more than 20 villages captured Thursday by the government. It added that Syrian troops have now besieged another Turkish observation post in an area known as Sheer Maghar.

The government-controlled Syrian Central Military Media said government forces advancing from northern parts of Hama province met Thursday with forces moving from southern Idlib, bringing wide areas under Syrian army control.

If government forces now turn north, they can eventually reach another major highway known as the M4 that links Syria’s coastal region with the country’s west. Assad has vowed to retake all of Syria.

Assad’s forces have captured dozens of villages over the past few days, including major rebel strongholds.

However, Erdogan said Thursday that, “The situation in Idlib has turned in our favor.” Speaking at the opening of a political academy in the capital, Ankara, he said the Syrian government had sustained “huge” losses.

Turkey’s Defense Ministry on Thursday said two Turkish soldiers were killed in Syria in an air attack the previous day, and that two others were wounded.

The Observatory reported that Syrian government warplanes struck a Turkish military post in the Jabal al-Zawiya region on Thursday, killing three soldiers and wounding others.