Leaders of the 800-member International Longshore and Warehouse Union Local 63 Office Clerical Unit reached a tentative accord late Tuesday and the clerical workers were to return to work Wednesday, the Los Angeles Times reported.
The union's full membership must ratify the deal before it becomes final.
Since the strike began Nov. 27, 20 ships went to rival ports in Oakland, Ensenada and Panama while others waited offshore for a resolution.
"This was at a critical juncture," Jack O'Connell, an international trade economist, told the Times. "The national economy is still trying to get on its feet and this strike would have been decidedly unhelpful. There are enough head winds out there already."
At the center of the dispute was the union's claim that employers have been outsourcing jobs through attrition.
"Tonight is the end of a very long journey," said Steve Berry, lead negotiator for the Los Angeles and Long Beach Harbor Employers Association.
There is "no outsourcing under this contract," Berry said.
The deal was struck after Los Angeles Mayor Antonio Villaraigosa brought in two federal mediators Tuesday morning to work toward breaking the stalemate, the Times said.
"Mission accomplished," said Villaraigosa, a former union leader, in announcing a tentative agreement was reached. "This has been a long eight days, but it's a great day for everybody now that a deal has been reached."
The clerical unit's strike was supported by the 10,000 regional members of the International Longshore and Warehouse Union, which honored the picket line and refused to work. The strike had idled 10 of the 14 cargo container terminals at the complex.