A marathon all-night bargaining session that saw negotiators working intensely to avoid a lockout saw a resolution just a couple of hours after the port lockout began.

The lockout had threatening to disrupt traffic at all B.C. ports, and the many goods flowing to Canadian households from overseas.

The tentative agreement between the International Longshore and Warehouse Union Canada and the BC Maritime Employers Association was announced at 10:30 a.m., on the heels of a port lockout that began at 8 a.m. Thursday and saw union workers walking picket lines and planning a protest at Deltaport.

“It’s an emotional moment,” said ILWU Canada president Rob Ashton, his voice breaking outside the downtown offices where the two sides culminated nearly 18 months of negotiations in the tentative agreement. “We’ve got a lot of strong people in our union and we’ve done a good job. And I want to thank them all. They’ve done us proud, our people.”

“We’re happy (the negotiation) is over,” added BCMEA president and CEO Mike Leonard. “It’s like no other; it’s grueling. It’s something you probably don’t want to repeat to often in a calendar year.”

Members of the B.C. longshore workers' union were locked out by their employers Thursday morning in a move that was expected to cripple port operations in Vancouver and elsewhere in the province, with the primary sticking point being concerns that jobs would be depleted as port operators looked toward automation to become more competitive with other ports like Seattle.

Leonard said the dispatch halls would be re-activated at 4:30 p.m. to resume port operations throughout the region as normal.

“We both believe that a deal that is fair and balanced was reached today and we believe that our respective memberships will ratify that deal,” he told reporters, though he refused to discuss details. “This is the end result we hoped to achieve all the way along. A negotiated settlement is the only way that is the proper way to end the conclusion of bargaining.”

Some 6,500 members of the union were affected by the lockout, which applied to all port operations except cruise ship and grain terminals. The BCMEA has pegged the economic impact at $5 billion dollars a day when factoring ripple effects across the country.

“With what we wanted to do, what was at stake, both parties knew we had to do it so there was a will to get it done and we got it done,” said Ashton.

“With a tentative deal, the ports open back up. That’s our first and foremost duty. We’ve got to take the deal for ratification on my side, obviously, but the ports are open: let’s rock and roll.”

With files from CTV News Vancouver's Sheila Scott and The Canadian Press