The extension came after the union and an alliance of port operators and shipping lines resolved one of the stickier points in their months-long contract negotiations, involving royalty payments to the longshoremen for each container they unload.
Negotiations will continue until at least midnight Jan. 28. Some important contract issues remain to be resolved, but the head of the Federal Mediation and Conciliation Service, George Cohen, said the agreement on royalties was "a major positive step forward."
"While some significant issues remain in contention, I am cautiously optimistic that they can be resolved in the upcoming 30-day extension period," he said.
The terms of the royalty agreement were not announced.
The master contract between the International Longshoremen's Association and the U.S. Maritime Alliance originally expired in September. The two sides agreed to extend it once before, for 90 days, but it had been set to expire again at 12:01 a.m. Sunday.
As recently as Dec. 19, the president of the longshoremen, Harold Daggett, had said a strike was expected.
A work stoppage would have idled shipments of a vast number of consumer products, from electronics to clothing, and kept U.S. manufacturers from getting parts and raw materials delivered easily.
Business groups expressed relief that the two sides had agreed to keep the ports open.
"A coast-wide port shutdown is not an option. It would have severe economic ramifications for the local, national and even global economies and wreak havoc on the supply chain," said National Retail Federation President Matthew Shay.
Major ports that would have been frozen included the massive terminals serving New York City overseen by the Port Authority of New York and New Jersey, and critical seaports in Savannah, Ga., Houston, and Hampton Roads, Va.
New York Shipping Association President Joseph Curto said avoiding a strike is critical "to thousands of workers who depend on port activities for their livelihood."
Other ports that would have been affected by a strike are in Boston; the Philadelphia area; Baltimore; Wilmington, N.C.; Charleston, S.C.; Jacksonville, Fla.; Port Everglades, Fla.; Miami; Tampa, Fla.; Mobile, Ala.; and New Orleans.
Longshoremen on the West Coast have a separate collective bargaining agreement.
Five things to know about the strike
1. PORTS THAT ARE AFFECTED
New York-New Jersey; Boston; Delaware River; Baltimore; Hampton Roads, Va.; Wilmington, N.C.; Charleston, S.C.; Savannah, Ga.; Jacksonville, Fla.; Port Everglades, Fla; Tampa, Fla.; Mobile, Ala.; New Orleans; and Houston.
2. THE DEADLINE
The parties agreed Friday to a second contract extension, this time for 30 days. Federal mediators are involved, and the White House has urged dockworkers and shipping companies to reach an agreement as quickly as possible.
3. A KEY STICKING POINT
Union members want the Maritime Alliance to drop a proposal to freeze royalties workers get for every container they unload, but the Alliance says longshoremen are well-compensated, earning an average of $124,138 per year in wages and benefits.
4. GOODS THAT WOULD BE AFFECTED
A wide range of items that are transported in containers on ships, including things like flat-screen TVs, sneakers and snow shovels.
5. GOODS THAT AREN'T AFFECTED
Items including military cargo, mail, and perishables such as food.