Hours after a longshoremen’s union on the East and Gulf coasts agreed to suspend its strike, major ports rushed to reopen Friday and get cargo to businesses that have spent the last few days racked with fear over lost sales.

The strike, which began Tuesday and shut down many of the nation’s largest shipping hubs, threatened to weaken the economy weeks before a national election. The Biden administration spent the last few days pressing the United States Maritime Alliance, the group representing port employers, and the union, the International Longshoremen’s Association, to find a way to end the strike.

The two sides announced late Thursday that they had reached a tentative agreement on wages — a 62% increase over six years — and said they were extending the current contract until mid-January to negotiate other issues. The biggest remaining one is the use of automated machinery at the ports, which the ILA considers a job killer. It was the first full-scale stoppage at East and Gulf coast ports since 1977.

Labor experts say the ILA has more leverage in contract negotiations than unions in most other industries, because a walkout can shut down shipping facilities for which there are no practical alternatives. Labor experts said the wage increase was a big victory for the ILA and its combative president, Harold J. Daggett, a 78-year-old, third-generation dockworker.

“The ILA seized the moment,” said William Brucher, an assistant professor at the Rutgers School of Management and Labor Relations. “Things really aligned in their favor.”

Longshoremen with several years of experience earn a lot more than workers in other professions that don’t require a college degree. At the Port of New York and New Jersey, nearly 60% of the longshoremen made $100,000 to $200,000 in the 12 months that ended in June 2020, according to the latest figures available from the agency that helped oversee the port.

Increasing wages by 62% — as proposed in the tentative agreement — could push up port costs that may be passed onto the businesses that ship goods, some economists said.

“I cannot recall an episode that had so little effect on the economy, led to such a short strike and resulted in such a huge increase in earnings for workers who are already making over $100,000 a year,” said Patrick L. Anderson, the CEO of the Anderson Economic Group, a consultancy. “We tend to shrug off the costs, but it does affect our ability to build things and export them.”

Longshoremen defend their big paychecks, saying they work long hours for them, often in harsh conditions.