Russian warships patrol the surface of the Black Sea, launching missiles at Ukrainian towns while creating a de facto blockade, threatening any vessel that might try to breach it.

Skimming the water’s surface, Ukrainian sea drones carry explosives stealthily toward Russian ports and vessels, a growing threat in Kyiv’s arsenal. In the airspace above, NATO and allied surveillance planes and drones fly over international waters, gathering intelligence used to blunt Moscow’s invasion, even as Russia fills the skies with its own aircraft.

Bordered by Ukraine, Russia and three NATO countries, but sometimes overlooked in the war, the Black Sea has become an increasingly dangerous cauldron of military and geopolitical tensions, following Moscow’s decision last month to end a deal ensuring the safe passage of Ukrainian grain.

Removed from the fierce fighting on the front, the Black Sea nevertheless puts Russia and NATO countries in the kind of proximity that does not exist in other theaters of the war, like the defense of Kyiv or the battle for Bakhmut — increasing the risk of confrontation.

“The Black Sea is now a zone of conflict — a war zone as relevant to NATO as western Ukraine,” said Ivo Daalder, a former American ambassador to NATO who runs the Chicago Council on Global Affairs.

After withdrawing from the grain deal, Russia pulverized Ukrainian Black Sea ports to stymie grain shipments key to Ukraine’s economy, and even struck sites on the Danube River a few hundred yards from Romania, a NATO member; the attack escalated fears that the military alliance would get drawn into the conflict.

Ukraine retaliated last week with two strikes on Russian ships on consecutive days — demonstrating its new reach with sea drones that can hit Russian ports hundreds of miles from its coast. And it issued a warning that six Russian Black Sea ports and the approaches to them would be considered areas of “war risk” until further notice.

“We must defend our own coast starting from the coast of the enemy,” the commander of the Ukrainian navy, Rear Adm. Oleksiy Neizhpapa, said in May as he made the case for a more robust response to what he called Russia’s tyranny on the international waters of the Black Sea.

The battle for control of the sea could have implications for global energy markets and world food supplies. And it will also almost certainly raise new challenges for NATO as it seeks to uphold a central tenet of international law — free navigation of the sea — without drawing the alliance directly into conflict with Russian forces.

In Washington, Biden administration officials had expressed reservations early in the war about Ukraine striking targets or conducting sabotage inside Russia, including its Black Sea ports, fearing that such attacks would only escalate tensions with President Vladimir V. Putin. Those concerns have lessened, though not disappeared.

The United States has prohibited the use of American weapons in any attack against Russian territory, and American officials say they do not pick targets for Ukraine. But the United States and Western allies have long provided intelligence to Ukraine that, along with its own extensive intelligence-gathering networks, Kyiv uses to select targets.

For centuries, the Black Sea has been at the center of Russia’s efforts to extend its geopolitical and economic influence, leading to clashes with other world powers, including multiple wars with the Ottoman Empire.

The ports along the warm waters facilitated trade year round. The location — a geopolitical crossroads — has offered Russia a place to project political power into Europe, the Middle East and beyond.

For years, Mr. Putin has sought to increase Moscow’s influence around the Black Sea, pouring government money into developing seaside ports and vacation cities and building up Russian military power at naval installations in the area for Moscow’s southern fleet.

The sea is equally important to NATO, which Mr. Putin insists is trying to destroy Russia. Three member nations — Turkey, Romania and Bulgaria — border the Black Sea itself, with four important ports. Five NATO partner countries are also in the region — Armenia, Azerbaijan, Georgia, Moldova and Ukraine.

Control over the Black Sea is an obvious war aim for Russia and one of the reasons in 2014 it annexed Crimea, a large peninsula on the northern coast of the sea, when a pro-Russian president of Ukraine was ousted in a rebellion.

Only hours after launching its full-scale invasion last year, Russian forces fired a missile that hit the commercial ship Yasa Jupiter, which flew the flag of the Marshall Islands; at least two other civilian ships were struck during attacks on Ukrainian ports up and down the coast.

Since then, Moscow has occupied three major Ukrainian ports. It has heavily mined the waters, neutralized the Ukrainian Navy and imposed a de facto blockade of civilian shipping to and from all Ukrainian-held ports.

Despite NATO’s expressed desire to avoid a direct confrontation with Russia, the risks of an inadvertent incident spiraling out of control have been growing for some time.

NATO and its member states are flying air surveillance and air policing missions over NATO territory, territorial waters and international waters over the Black Sea, but are careful not to stray into the war zone.

In March, in the only known physical contact between the Russian and American militaries during this war, a Russian warplane struck a U.S. surveillance drone, causing its operators to bring it down in international waters.

But recently NATO has increased the number of such surveillance flights and air policing, the alliance announced after the second NATO-Ukraine Council meeting on July 26.

Ukraine and some shipping industry leaders have called for Western allies to provide naval escorts to ships willing to defy Russian threats and carry grain from ports in Ukraine, but there are numerous problems with that.

For one, Turkey has been firm in trying to keep its NATO allies from escalating tensions with Russia in the Black Sea. Turkey has also been trying to convince Mr. Putin to return to the grain deal it helped broker, even if hopes are dimming, said Sinan Ulgen, a former Turkish diplomat and director of EDAM, a Turkish research institution.

“Turkey has been very adverse to any NATO mission in the Black Sea, feeling that a higher NATO presence there would increase the risk of conflict with Russia,” Mr. Ulgen said.

Since the Russian invasion, Turkey, which controls passage in and out of the Black Sea through the Bosporus and Dardanelles Straits under a 1936 convention, has banned Russian and Ukrainian warships from using the Straits, an act praised by Ukraine and NATO.

But Turkey has also asked allies not to send in their own warships.

“So the underlying tension here is about how the U.S. and Turkey look at the Black Sea and how they frame it within the security umbrella of NATO,” Mr. Ulgen said. “But so far, since Turkey closed the straits to Russian warships, the U.S. has not tried to corner Turkey.”

For months, Ukraine could do relatively little to combat Russia’s control of the water, but it never stopped working to develop a threat to challenge Russia’s vastly more powerful naval forces.

Ukraine used maritime drones to attack the Russian naval fleet in October. At the time, it was unclear if it would become a consistent, effective part of its arsenal. But then last week it struck with stealth and surprise at two Russian ships, hitting both.

“Our vision is based on the need to substitute Soviet principles of ‘mass and power’ with Western principles of ‘quality’ and ‘necessary capabilities,’” Admiral Neizhpapa, the Ukrainian naval commander, wrote for the U.S. Naval Institute.

P.W. Singer, a specialist on 21st century warfare at the New America think tank in Washington, said that Ukraine is benefiting from a much-improved new generation of its seaborne drone fleet.

In less than a year, Mr. Singer said on Sunday, the drone boats have evolved into larger, faster, stealthier seacraft that can carry more explosives.

The makers of the drone say it is designed for an array of missions, from surveillance to combat; can travel at about 48 miles per hour; and has a range of up to 450 nautical miles. At that range, a drone fired from Ukraine’s Black Sea port of Odesa could reach Novorossiysk, which Ukraine struck on Friday — though it is not known how or from where the drone was launched.

Mr. Singer said Ukraine’s rapid progress in building drones was “almost Silicon Valley-like.”

While Russia’s invasion has spurred widespread outrage in the West, it has also escalated concerns about surging oil prices that could shock the global economy.

More than 3 percent of global oil and oil products move through the Black Sea. Historically, about 750,000 barrels of Russian crude oil, or 20 percent of its crude exports, leave from the Black Sea, though the country has reduced such shipments to between 400,000 and 575,000 barrels a day, according to tanker tracker companies, as Russia sought to support prices with its producing partner Saudi Arabia.

Ukrainian officials have made it clear that they hope by expanding the war to Russia’s ports, they can inflict some economic pain on Moscow.

Mykhailo Podolyak, a senior adviser to the Ukrainian president, said that as long as the Kremlin refuses to comply with international law, it can expect “a sharp reduction in Russian commercial potential.”

Nevertheless Russia has proved to be a resilient oil supplier.

After major oil traders and major international oil companies refused to sell Russian oil following its invasion of Ukraine, newly incorporated trading firms and shipping companies based in the United Arab Emirates, Greece and Hong Kong have taken up the slack.

David Goldwyn, a former State Department official with responsibility for energy issues, said oil prices could rise $10 to $15 a barrel if Russian exports from the Black Sea are displaced.

Oil is now trading at about $85 a barrel, holding steady even after Ukraine struck the Russian tanker over the weekend.

The question now, said Sarah Emerson, president of Energy Security Analysis, a consulting firm, is whether “the Ukrainians can do this over and over again. This would tighten energy markets that are already tightening.”

Marc Santora reported from Kyiv and Steven Erlanger from Berlin. Cliff Krauss, Lara Jakes, Eric Schmitt, Paul Sonne and Matt Bigg also contributed reporting.