A looming labor shutdown of ports on the US East Coast was averted Friday when federal mediators helped workers and shippers reach a breakthrough on a key issue in deadlocked contract talks.

The Federal Mediation and Conciliation Service said the two sides had agreed to extend final contract negotiations for another 30 days past the midnight Saturday deadline after a compromise on the most contentious issue, the container royalty surcharge, was achieved.

"The container royalty payment issue has been agreed upon in principle by the parties, subject to achieving an overall collective bargaining agreement," said FMCS Director George Cohen.

"The agreement on this important subject represents a major positive step toward achieving an overall collective bargaining agreement. While some significant issues remain in contention, I am cautiously optimistic that they can be resolved in the upcoming 30-day extension period."

The powerful International Longshoremen's Association had threatened to have its 14,500 members in 14 key ports from Maine to the US Gulf Coast walk out on Sunday after months of negotiations with the US Maritime Alliance -- representing port management and shippers -- had failed to produce a new contract.

A strike at the key shipping hubs would have battered the economy that is already under threat from the looming fiscal cliff tax hikes and spending cuts slated to take effect from January 1, if political leaders cannot agree on an alternative.

The main issue was the royalty payment, a 42-year-old surcharge on containers handled in ports originally meant to offset job losses for union members due to containerization.

The ILA objected to a proposed cap on the amount collected for the surcharge -- currently $4.85 for each ton of containerized cargo -- which has grown to become a key part of union members' pay.

Shippers and port managers said the surcharge has risen too much and is outdated now that containerization is standard, and that it pushes the cost of shipping in US ports to uncompetitive levels.

Cohen said the compromise on the surcharge would remain secret until the rest of the new labor contract can be finalized.