A cyberattack that infected computers across Europe and then spread into the United States halted operations at the Port of Los Angeles’ largest terminal Tuesday — and raised worries that destructive software could ricochet around the world and disrupt the critical supply chain.

APM Terminals — where Danish shipping carrier A.P. Moller-Maersk operates — turned truckers away all day, as did their terminals in Rotterdam, New York and New Jersey.

“Maersk IT systems are down across multiple different sites and business units due to a cyber attack,” said Concepcion Boo, a spokesperson for the company. “We are assessing the situation in each terminal and we are tracking down what’s going on in all our business units.”

The carrier is the world’s largest — accounting for about 16 percent of the world’s shipping fleet.

PROGRAM DEMANDED PAYMENT

“This event has sent shock waves through the supply chain, causing all parties to reevaluate their cyber security defenses,” said John McLaurin, president of the Pacific Merchant Shipping Association, a group representing terminal owners and operators.

Ukraine and other parts of Europe were hit particularly hard by the new strain of ransomware — malicious software that locks up computer files with all-but-unbreakable encryption, The malware demands a ransom before it will set the files free.

As the program began to spread across the United States, it affected companies such as pharmaceutical giant Merck and Mondelez International, the owner of food brands such as Oreo and Nabisco. But the malware’s damaging pace appeared to slow as the day wore on.

Officials at the local APM Terminals, owned by the Maersk Group, could not be reached but a spokesman for the port said the company had “shut down normal operations at the terminal through Tuesday.”

“There were no ships at berth at the terminal, and none are scheduled on Tuesday or Wednesday,” said Phil Sanfield, a spokesperson for the Los Angeles port. “Trucking companies and others have been notified not to come to the terminal.”

Overall operations have been minimally impacted, port officials.

PORT SECURITY CONCERNS

It’s not clear how broadly the attack struck the world’s ports, but the intrusion underlines deep concerns about cybersecurity at the nation’s cargo hubs — especially in Los Angeles and Long Beach, which combine to provide a major gateway for Pacific Rim trade.

About 90 percent of the world’s goods are shipped on the ocean and cyber experts say a serious outbreak could devastate local trade.

“If you stay off line for too long, it will have a ripple effect to importers and exporters and that will impact the whole supply chain to the stores,” said Lars Jensen, CEO of CyberKeel, a maritime cybersecuity consultants based in Copenhagen. “For a shipping line to go off line for a number of hours isn’t necessarily a major deal but it fit stretches into a prolonged period you will have ripple effect across all the stakeholders in the economy.”

It’s too early to unpack the nature of this attack, he said. But how quickly Maersk can restore backup data from scratch, if needed, will “be a measurement of how well they are prepared.”

Cybersecurity has long been a concern of port officials, but each terminal runs a separate system much like airline operators in an airport.

“I am sure this will be the topic of a lot of discussion in the maritime industry in the weeks and months to come,” Sanfield said.

SWEEPING ACROSS EUROPE

The number of companies and agencies across Europe reportedly affected by the ransomware campaign piled up swiftly Tuesday, and the electronic rampage rapidly snowballed into a real-world crisis.

Dutch daily Algemeen Dagblaad said that container ship terminals in Rotterdam run by a unit of Maersk were also affected.

A message on Maersk’s website said: “We can confirm that Maersk IT systems are down across multiple sites and business units due to a cyber attack. We continue to assess the situation. The safety of our employees, our operations and customer’s business is our top priority.”

Company and government officials reported serious intrusions at the Ukrainian power grid, banks and government offices, where one senior official posted a photo of a darkened computer screen and the words, “the whole network is down.” Ukraine’s prime minister said the attack was unprecedented but that “vital systems haven’t been affected.”

MODERNIZING SYSTEMS

This comes as both local ports are grappling with how to modernize their aging cargo-tracking systems.

International shipping carriers are integral to the Southern California economy. The idea is to make their digital data more accessible to shippers, retailers, cargo movers, truckers and others.

Earlier this year, APM Terminals, Maersk and Mediterranean Shipping Company launched a pilot program to track cargo and share information with their clients. Major retailers such as The Home Depot and Lowe’s were among others, are participating in the project.

SPREADS LIKE DISEASE

There’s very little information about what might be behind the disruption at each specific company, but cybersecurity experts rapidly zeroed in on a form of ransomware.

“A massive ransomware campaign is currently unfolding worldwide,” said Romanian cybersecurity company Bitdefender. In a telephone interview, Bitdefender analyst Bogdan Botezatu said that he had examined samples of the program and that it appeared to be nearly identical to GoldenEye, one of a family of hostage-taking programs that has been circulating for months.

It’s not clear whether or why the ransomware has suddenly become so much more potent, but Botezatu said that it was likely spreading automatically across a network, without the need for human interaction. Self-spreading software, often described as “worms,” are particularly feared because they can spread rapidly, like a contagious disease.

The Associated Press contributed to this report.