A container ship sits docked in a berth at the Port of Oakland last week.

Story highlights

NEW: Contract is for five years, awaits vote of union members

NEW: Port of Oakland officials say it could be weeks before things get back to normal

Operations have been affected at 29 ports

CNN  — 

Dockworkers at West Coast ports have reached a tentative contract agreement to end their labor dispute, a spokesman for the Pacific Maritime Association said Friday.

“A deal has been struck. An official statement is forthcoming,” Steve Getzug said.

The five-year contract still has to be approved by the dockworkers union members.

The dispute had centered around contract negotiations between the Pacific Maritime Association, which represents shipping companies and port operators, and the International Longshore and Warehouse Union, which represents West Coast dockworkers.

The two parties began talks in May but were unable to reach an agreement and had been operating without a contract since July.

Operations have been affected at 29 ports.

U.S. Labor Secretary Thomas Perez was in San Francisco to help mediate the dispute.

“They’re already working but they’ll be back in full force tomorrow,” Perez said. “And I am confident that up and down the West Coast there is an acute awareness of the need to reduce the backlog (of ships needing to be unloaded). And that is job one.”

The Port of Oakland said on its website that it could take six to eight weeks for the situation at its facility to return to normal.

“Ships, containers and chassis are all out of balance. They’re not where they need to be to support cargo movement. Repositioning of these assets will take some time,” the port said on its Maritime Operational Status page.