The defense ministry of Romania, a NATO member, said on Friday that a Russian missile had come within 22 miles of its border but that it did not cross into the country’s territory, countering a claim made by the Ukrainian military.

Ukraine’s top military commander had said earlier in the day that two Russian missiles crossed into the airspace of Moldova and Romania before entering Ukraine and being directed at targets in the country.

Although Russian missiles have been reported over Moldovan air space during the war, it would have been the first such instance of a Russian missile entering Romanian airspace.  Such a violation would risk inflaming tensions between NATO and Moscow.

Romania’s defense ministry said in a statement that when a missile was detected near the north of the country’s territory, two of its fighter jets that were conducting drills under NATO command were redirected to the area, but that they resumed their original mission once the situation became clear.

NATO declined to comment on the episode. Moldova’s foreign ministry confirmed that the missiles had passed over its airspace, and said it had summoned the Russian ambassador to discuss the incident.

Daniel Voda, a spokesman for the Moldovan ministry, condemned the violation of the country’s airspace, saying in a statement, “We strongly reject the recent unfriendly actions and statements in relation to the Republic of Moldova, which is absolutely unacceptable by our people.”

The missiles involved in the incident were part of a broader Russian assault that featured dozens of drones, rocket and cruise missiles aimed at critical Ukrainian infrastructure across the country.

Russia has previously fired drones and missiles over Moldova into Ukraine, prompting diplomatic protests from the government there. Debris from a Russian missile shot down by Ukrainian air defenses landed in a border village in Moldova in October.

Since Russia launched its full-scale invasion of Ukraine nearly a year ago, there has been concern that the conflict could escalate either by design or by accident.

In November, when an explosion in Poland near the Ukrainian border killed two people, Ukrainian officials were quick to claim that it was the result of a Russian rocket. When it was determined to instead be a Ukrainian air-defense missile, fears eased over the prospect that NATO would become more deeply embroiled in the war.

Western officials also made the findings of that investigation public, given that Russia and NATO both say that they do not want to engage in a direct war with each other. Although NATO members have sent military aid to Ukraine, both sides also have made some effort to keep the war from spilling over into neighboring countries.

On Friday, Valery Zaluzhny, the commander in chief of Ukraine’s Armed Forces, said in a statement that two Kalibr cruise missiles fired from the Black Sea had crossed into Moldovan airspace at 10:18 a.m. and then crossed Romanian airspace 15 minutes later. He said the missiles had then made their way back into Ukraine after crossing at a juncture where the three countries’ borders meet.

The spokesman for the Ukrainian Air Force, Yuriy Ihnat, told the Ukrainska Pravda news outlet that Ukraine had the opportunity to shoot down the missiles on Friday, but that it had not immediately done so because of the risks to the population of a foreign country.

Matina Stevis-Gridneff contributed reporting.