For over two years, a backlog of as many as 109 container ships waited off the California coast for their turn to dock and unload in the San Pedro Bay ports complex, slowing deliveries and polluting the air. But as of Tuesday, the backlog is no more.

Since October 2020, the Marine Exchange of Southern California has tracked the number of container ships waiting at anchor off the coast or slow steaming toward the twin ports of Long Beach and Los Angeles. From mid-October to February 2021, the backlog rose to 42 ships.

By June of that year, the backlog dropped down to a promising nine ships. In late summer, however, the backlog began to grow steadily. By January 9, 2022, there were 109 container ships waiting to access the ports.

Since its peak, the vessel backlog fell steadily. It has mostly been in the single digits since mid-September, and it reached zero for the first time in 25 months on Tuesday.

“Whether at sea or on land, everyone working in the supply chain deserves credit for chipping in to solve a problem with no precedent,” Port of Long Beach Executive Director Mario Cordero said in an email Wednesday. “Many of the tools we developed to reduce wait times at marine terminals, such as vessel queueing and slow steaming, are innovations we can deploy for future surges.”

Cordero cautioned, however, that ports nationwide, but especially on the West Coast, are not out of the woods yet.

Since contracts expired on July 1, the International Longshore and Warehouse Union has been in contentious labor negotiations with the Pacific Maritime Association. The union represents over 40,000 West Coast dockworkers, while the association represents terminal operators and shippers.

Both groups have agreed to a full media blackout during negotiations, but automation is one of the hot topics. Though they are months in with no resolution, the union so far continues to move cargo without any slowdowns or strikes.

The heavy congestion at the San Pedro Bay ports and the uncertainty surrounding ongoing labor negotiations caused shippers to divert cargo to other ports around the country, reducing the market share of the ports of LA and Long Beach, which have regularly ranked as the first and second busiest in the nation, respectively, for years.

The loss of market share is now threatening the twin ports’ positions. In October, for the third month in a row, the Port Authority of New York and New Jersey moved more containers than either of the West Coast giants.

The East Coast port moved 792,548 20-foot-equivalent units (the standard measure of a shipping container). LA and Long Beach, meanwhile, moved 658,428 and 678,429 TEUs, respectively.

Prior to the last three months, New York-New Jersey had only moved more cargo than the twin ports twice in the last four years—in February and March 2020, when Chinese ports closed amid the outbreak of the coronavirus pandemic.

“We’ll do everything in our power to get that cargo back,” Port of LA Executive Director Gene Seroka said in an email Wednesday. Seroka noted that transpacific trade is crucial for the U.S. economy. More than 50% of imports into the twin ports comes from China.

Rail workers also are in the midst of heated contract negotiations, centered around better pay, more regular schedules, increased safety and sick time. While some unions have approved contracts with operators, there are several holdouts, including the country’s third largest railroad union, the Brotherhood of Maintenance of Way Employees Division, which represents over half the track maintenance workers.

A rail strike would cripple the U.S. supply chain, as upward of 40% of goods are moved by train, including about 25% of imports into the Port of Long Beach. The impacts of a potential strike are so severe that the White House stepped in to help broker a deal. The Biden administration announced in September that two unions agreed to a tentative deal.

This week, however, one of the most politically powerful rail unions—SMART Transportation Division—voted to reject the Biden deal, joining three other unions that have failed to approve contracts.

Despite eight out of 12 unions having ratified agreements, all rail workers would honor the picket line if any union were to strike, BLET President Dennis Pierce told CNBC.

If no agreement is reached, a series of short strikes are planned beginning in early December through January.

“We are hopeful and expect that issues of concern such as labor negotiations will be solved to the benefit of all parties,” Cordero said. “Everyone recognizes how important the smooth delivery of cargo is to the economy, especially after the pandemic.”

The Associated Press contributed to this report.