The union that represents dockworkers along the West Coast have ratified a three-year contract extension, a move that will likely quell fears of a work stoppage or slowdown in 2019 when the contract was originally set to expire.

The International Longshore and Warehouse Union announced Friday that 67 percent of its members, which include dockworkers at the ports of Long Beach and Los Angeles, approved the extension through July 1, 2022.

“The rank-and-file membership has made their decision and expressed a clear choice,” ILWU International President Robert McEllrath said in a statement Friday. “During the past year we saw a healthy debate and heard different points of view, with concerns raised by all sides. The democratic process allowed us to make a difficult decision and arrive at the best choice under the circumstances.”

The news comes nearly three years after contentious negotiations resulted in a major backlog of cargo ships outside the harbor.

A breakdown in contract talks between the ILWU and the workers’ employers, represented by the Pacific Maritime Association, slowed cargo movement and cost the economy billions of dollars as retail inventories were held up on the docks.

It also sullied the reputation of the nation’s busiest seaports, Los Angeles and Long Beach, which was already losing market share to East Coast hubs.

The contract extension will raise wages, maintain health benefits, and increase pensions, the union said.

The ILWU represents roughly 20,000 workers at 29 ports across California, Oregon and Washington.

The unusual early vote came amid pressure from manufacturers, retailers and other local, regional and national groups dependent on the ports to move everything from flat-screen TVs from China to Central California grain for export as consumer demand for fast, cheap products continues.

“With this contract extension, the West Coast waterfront has a tremendous opportunity to attract more market share and demonstrate that our ports and our workforce are truly world-class,” Pacific Maritime Association President James McKenna said in a statement last week.