ISTANBUL — Turkey’s president warned Tuesday that his government would not allow Syria’s military to advance farther across a rebel-held northern Syrian province, a day after tensions between the two countries escalated into some of their deadliest clashes in years.

The violence erupted after Turkey accused Syria of killing five of its soldiers and three additional military personnel in Idlib, the northern province. Retaliatory strikes by Turkey, using warplanes and artillery, killed dozens of Syrian soldiers, Turkish officials said.

A Syrian military offensive to recapture Idlib, the country’s last rebel-held province, was “driving innocent, grieving people” to Turkey’s borders, Turkish President Recep Tayyip Erdogan told reporters. “We will not give Syria the opportunity to gain ground there, because now this increases our burden.”

But there was little sign that Erdogan’s comments — or Turkey’s recent deployment of troops to Idlib — had done anything to blunt an accelerating Syrian advance. Syria’s state news agency reported Tuesday that the military had captured a portion of a strategic highway that connects the city of Aleppo with Latakia, in western Syria.

The capture of a village along the highway put Syrian President Bashar al-Assad’s forces roughly five miles away from Idlib’s densely populated provincial capital.

U.S. Secretary of State Mike Pompeo on Tuesday condemned the attack on the Turkish soldiers, calling it a “grave escalation,” adding that “we fully support Turkey’s justified self-defense actions in response.” Pompeo also blamed the Syrian government and its allies, including Russia and Iran, for their “continued, unjustifiable, and ruthless assaults on the people of Idlib.”

Erdogan began warning of possible Turkish military action against Syria last week, citing concern that tens of thousands of displaced Syrians were heading toward the Turkish border. His warning came after the collapse of a cease-fire announced by Turkey and Russia in mid-January and following the capture by Assad’s forces of a key town in southern Idlib.

Turkey maintains military observation posts throughout Idlib and surrounding areas — a presence that was aimed at decreasing violence there but now appears to heighten the risk of skirmishes as the Syrian offensive gathered steam.

After the clashes on Monday, there were also signs of a widening rift between Turkey and Russia. The two governments had maintained cordial relations despite a growing list of foreign policy disagreements, including over Syria’s offensive in Idlib. Russia has supported that offensive with airstrikes and other military support.

Mevlut Cavusoglu, Turkey’s foreign minister, chided Russia on Tuesday for failing to rein in Assad’s military. “We disagree with excuses that say, ‘We cannot completely control the regime,’ ” Cavusoglu told reporters in Ankara, the Turkish capital. “The purpose of this dialogue with Russia is to provide peace again. But the regime also needs to be restrained.”

His Russian counterpart, Foreign Minister Sergei Lavrov, speaking to Russian newspaper editors Tuesday, said Turkey had failed to meet several of its commitments under agreements aimed at de-escalating the fighting in Idlib. He also suggested that the death of Turkish soldiers on Monday was at least partly Ankara’s fault.

“The Turkish servicemen advanced toward certain objects inside the Idlib de-escalation zone without warning us, so we were unable to warn the Syrian army,” Lavrov said, according to the Tass news agency.

Tensions between Turkey, Syria and Russia have escalated amid increasingly desperate warnings about the plight of 3 million civilians who live in Idlib. More than 10 percent of the population — 390,000 people — were displaced from homes or places where they were sheltering in December and January alone, the United Nations said.

At the same time, the province was running out of medical facilities able to treat its residents, Syrian and international medical groups said. At least 53 health facilities suspended services in January “due to insecurity, threats of attacks or the simple fact that entire areas have been deserted by civilians seeking refuge from violence and daily bombardments,” the World Health Organization said in a statement.

The latest casualty was a health center in Sarmin, a town in the path of the Syrian advance. The facility was hit by an “aerial missile” on Tuesday morning, according to the Syrian American Medical Society, which provides support to the health center.

The center had once offered services to thousands of people and delivered 60 babies a month. The strike on Tuesday had rendered the clinic “inoperable,” the group said.

Sarah Dadouch in Beirut contributed to this report.