Updated

Dockworkers at major ports all along the East and Gulf coasts have struck a deal that, for now, averts a strike that threatened to freeze shipments and cripple the economy at a vulnerable time.

A federal mediator announced Friday that an expired contract for workers in the International Association of Longshoremen would be extended for 30 days while negotiations continue. The announcement was made shortly before the contract was set to expire this weekend, which could have triggered a massive strike by Sunday.

The negotiations affect 15,000 dockworkers at 15 major U.S. ports, from Boston all the way down to Houston. The White House in recent days had urged all sides to come together to reach an agreement "as quickly as possible."

The dockworkers had threatened to strike, just as the looming fiscal crisis is poised to hit next week without a deal in Congress. The combination of tax hikes, federal spending cuts and a freeze in shipments at East and Gulf coast ports was poised to do major economic damage.

The fiscal crisis still looms, but the possibility of a dockworker strike has been staved off for at least a month.

The master contract between the International Longshoremen's Association and the U.S. Maritime Alliance, a group representing shipping lines, terminal operators and port associations, expired in September. The two sides agreed to extend it once already, for 90 days, but they had until Friday balked at extending it again when it expires at 12:01 a.m. Sunday.

The union wanted the Maritime Alliance to drop a proposal to freeze the royalties workers get for every container they unload. The Alliance has argued that the longshoremen, who it said earn an average $124,138 per year in wages and benefits, are compensated well enough already. The dispute over royalties has apparently been resolved, though other areas of disagreement remain. Negotiations will continue until at least midnight on Jan. 28.

If a strike eventually happens, the walkout could be the biggest national port disruption since 2002, when unionized dockworkers were locked out of 29 West Coast ports for 10 days because of a contract dispute.

The ports only reopened after President George W. Bush, invoking powers given to him by the 1947 Taft-Hartley Act, ordered an 80-day cooling-off period. Some economists estimated that each day of that lockout cost the U.S. economy $1 billion. It took months for the retail supply chain to fully recover.

An East Coast port freeze would have its biggest impact at the Port Authority of New York and New Jersey, where 3,250 longshoremen handled 32.3 million tons of cargo in 2010. The authority is not a party to the contract dispute.

Other major ports affected would include Savannah, Ga., which handled 18 million tons, and Houston and Hampton Roads, Va., which each handled more than 12.5 million tons.

The Associated Press contributed to this report.