The war between Israel and Hamas has so far not had a major impact on the global economy. But a wave of attacks against merchant ships in the Red Sea could change that in a big way.

The Houthis, an armed group backed by Iran that controls much of northern Yemen, have been using drones and missiles to target ships since Hamas attacked Israel on Oct. 7. That has forced some shipping giants and oil companies to avoid the Suez Canal, a development that could hamper global trade and push up the cost of imported goods.

The Suez is a vital artery for container ships and fuel tankers. Goods and fuel from Asia and the Middle East have made their way to Europe and the United States through the passage since it opened in 1869. Britain and other world powers have fought wars and engaged in geopolitical intrigue over the canal, controlled by Egypt now, for more than a century.

About 50 vessels go through the Suez Canal a day, and recent data suggested that, as of Monday, at least 32 had been diverted, said Chris Rogers, head of supply chain research at S&P Global Market Intelligence. He noted that nearly 15 percent of European imports were transported by sea from Asia and the Persian Gulf, most of which go through the Suez.

Peter Sand, chief analyst at Xeneta, a shipping market analytics company, described the problems in the Red Sea and the canal as “a slow-burning disaster that really blew up on the weekend.” He added, “Everybody involved in global shipping, especially with supply chains connected by the Suez Canal, is trying to find out where their goods are, where they are heading.”

U.S. Defense Secretary Lloyd J. Austin III on Monday announced a new multinational force that would seek “to jointly address security challenges in the southern Red Sea and the Gulf of Aden, with the goal of ensuring freedom of navigation for all countries and bolstering regional security and prosperity.”

The companies that transport products like toys and electronics from Asia in vast container ships have also said they will stop sending vessels into the area. A ship belonging to one of those companies, Maersk, was attacked last week.

Maersk said on Tuesday that all of its ships bound for the Red Sea would be rerouted around Africa via the Cape of Good Hope “to ensure the safety of our crew, vessels and customers’ cargo onboard.” Until it was safer to use the route, the detour around Africa would be “a faster and more predictable outcome for customers and their supply chains.”

The instability near the Suez Canal comes at a time when a drought has forced the operators of the Panama Canal, another critical link in global supply chains, to slash the number of vessels that can use that waterway.

Some 12 percent of world trade goes through the Suez Canal, and 5 percent through the Panama Canal. When shipping companies avoid the canals, they often must spend millions of dollars more on fuel for ships to take longer routes.

Sailing from Asia to Europe via the Cape of Good Hope instead of the Suez Canal is a diversion that would lengthen the journey from Singapore to Rotterdam in the Netherlands by 3,300 miles, or nearly 40 percent.

Mr. Sand said taking the Cape of Good Hope route could add roughly $1 million, or around a third, to the cost of a round trip from Asia to Europe. He added that some shipping rates had risen 20 percent in recent days.

A portion of that additional cost could be passed on to consumers just as inflation is slowing in the United States and Europe.

The attacks have already appeared to push up the price of oil. Brent crude, the international oil benchmark, has risen about 5 percent from its low earlier this month.

The economic impact has increased the pressure on the United States and other countries to stop the attacks by the Houthis. Shipping executives said such force was necessary.

“If you closed down the Suez Canal, it would have some huge ripple effects,” said Oystein Kalleklev, the chief executive of Avance Gas, which transports propane from the United States to Asia. “So, we will think that there will be sufficient naval ships in order to stabilize the situation.”

Just over two years ago, the Suez Canal was the source of another supply chain scare. One of the largest container ships ever built got stuck for days in the canal, blocking other vessels from using the crossing. That episode occurred when supply chains were overwhelmed by the huge demand for home appliances, electronics and other goods during the pandemic.

By comparison, the current attacks in the Red Sea are happening during a period of relatively slack demand. As a result, Mr. Rogers of S&P said in an email, their impact will be limited “if the disruption lasts days rather than weeks or months.”

The delays at the Panama Canal prompted some shipping companies that transport goods from Asia to the East Coast of the United States to send ships through the Suez Canal instead. But the problems in the Red Sea could now force them to go around the Cape of Good Hope, lengthening those trips even more.

Unlike the Suez Canal, the Panama Canal uses locks, which lift vessels up and down as they cross from one ocean to another. The lack of rain has reduced the amount of water available to fill the locks, and the Panama Canal authority has had to reduce the number of ships using the waterway. That number could fall further because the dry season is just beginning.

“The Panama Canal situation,” Mr. Kalleklev said, won’t be “over anytime soon.”