LOS ANGELES – Negotiators reached a tentative contract covering West Coast dockworkers on Friday evening, likely ending a protracted labor dispute that snarled international trade at seaports handling about $1 trillion worth of cargo annually.

The breakthrough came after nine months of negotiations that turned contentious in the fall, when dockworkers and their employers began blaming each other for problems getting imports to consumers and exports overseas.

The five-year deal still must be approved by the 13,000-member International Longshore and Warehouse Union's rank-and-file. They work 29 ports from San Diego to Seattle that handle about one-quarter of all U.S. international trade, much of it with Asia.

Negotiators for the union and the Pacific Maritime Association, which represents oceangoing shipping lines and the companies that load and unload cargo at port terminals, began talking formally in May. Their prior six-year contract expired July 1.

U.S. Secretary of Labor Thomas Perez said that both the dockworkers' union and their employers agreed to resume work Saturday evening. In recent weeks, employers cut most weekend work, saying they would not pay extra wages.

"We are pleased to have reached an agreement that is good for workers and for the industry," said maritime association President James McKenna and union President Bob McEllrath said in a joint written statement. "We are also pleased that our ports can now resume full operations."

After initial signs of progress, in the fall employers publicly charged dockworkers with creating a congestion crisis to gain bargaining leverage by slowing their work rate and withholding the most skilled workers. The union responded that its members were working safely and blamed the jam on broader dysfunction at West Coast ports that predated contract talks, notably a lack of truck beds to tow containers from dockside yards to distribution warehouses.

By January, the maritime association's members stopped ordering night work crews to load and unload ships. Union members called it an attempt to hurt workers in their pocketbooks; their negotiators soon agreed to the involvement of a federal mediator.

In early February, the CEO of the maritime association publicly warned that if no agreement could be reached, employers would stop calling workers and shut down the ports within days. Weekend and holiday lockouts of many longshoremen followed, though major ports were not fully closed.

Instead, cargo trickled through. Massive oceangoing ships anchored off the coast of Los Angeles and near the ports of Oakland and Seattle, waiting for berths.

In Minnesota, some companies rerouted products, some sending them by air, while others lost sales because merchandise was stuck.

Both Target and Best Buy officials said they had had to troubleshoot orders, diverting them to airfreight or prioritizing which of the items were in the latest shipments.

Exporting from Minnesota wasn't affected as much as imports, said Ed Dieter, at the Minnesota Trade Office.

"Only about a quarter of our exports go by sea," Dieter said.

Others put their merchandise on ships taking alternate routes. Some 37 percent of Minnesota exports travel by air because they are high-value and relatively small items. Also, a lot of Minnesota exports go to Canada and Mexico by truck or rail.

The Minnesota exporters most affected by the gridlock were meat and specialty grains businesses that sell their products in Asia, said Bruce Abbe, president of the Midwest Shippers Association, which covers Minnesota, Wisconsin, Iowa, North Dakota and South Dakota.

"I have a number of members who have said they've turned down business overseas, and they've done it because they realize they couldn't guarantee they could deliver," Abbe said.

Meat shipments from a growing group of exporters in Iowa and Minnesota, especially, are time sensitive and have to be refrigerated all along the way. Usually the meat is trucked to refrigerated containers on the West Coast.

"This has been totally disruptive for them, and their costs are huge," Abbe said.

Jeffrey Ettinger, Hormel Foods CEO, was asked about the impact of the labor slowdown by a stock analyst on Thursday's earnings conference call: The total impact to Hormel is "not meaningful," he said.

"Compared to a lot of other companies, we're probably not as exposed," Ettinger said.

General Mills has seen "some impact," but had been able to make adjustments such as other shipping routes, said spokeswoman Bridget Christenson in an e-mail.

Staff writers Adam Belz and Mike Hughlett contributed to this report.