Teamsters members at UPS have voted in favor of ratifying a long-anticipated labor contract that will give them pay raises, more full-time jobs and better working conditions.

The 5-year agreement covers some 340,000 drivers, package handlers and other workers at Sandy Springs-based UPS, making it the largest private collective bargaining agreement in North America.

The contract was ratified with a 86.3% of ballots cast in favor, according to the International Brotherhood of Teamsters union. Voting was held from Aug. 3 through Tuesday with online ballots.

All supplemental agreements were also ratified by members, except for a supplement that covers 174 workers in Florida. As a result, the national master agreement won’t go into effect until after the supplement is renegotiated and ratified, with meetings starting immediately.

“Our members just ratified the most lucrative agreement the Teamsters have ever negotiated at UPS. This contract will improve the lives of hundreds of thousands of workers,” said Teamsters General President Sean O’Brien in a written statement. “Teamsters have set a new standard and raised the bar for pay, benefits, and working conditions in the package delivery industry. This is the template for how workers should be paid and protected nationwide, and nonunion companies like Amazon better pay attention.”

The contentious negotiations started earlier this year and raised the threat of a crippling strike, before a deal was struck in late July.

The deal approved Tuesday gives current part-time workers raises to at least $21 per hour immediately, according to the Teamsters. Full-time delivery drivers would get wage increases to an average top rate of $49 per hour.

Existing full-time and part-time workers will get raises of $2.75 per hour this year, and $7.50 more per hour over the length of the contract.

UPS issued a statement saying its Teamsters-represented employees “voted to overwhelmingly ratify” the agreement.

The union said the agreement passed by the “highest vote for a contract in the history of the Teamsters at UPS.” Of the members eligible to vote, 58% cast ballots, which the union said was the highest turnout ever for a UPS contract.

The Teamsters aim to use the UPS deal to show workers at Amazon and other companies what unionizing could bring them.

“We’ve achieved something historic,” O’Brien said in an update to members Tuesday evening. “This is something to build on,” he said.

Some workers had sought bigger pay raises, however, with the most ardent labor activists pushing for starting wages of $25 per hour for part-timers.

The union made a big push for members to support the deal and vote for it over the last three weeks, holding meetings for UPS workers throughout the country and deploying local union leaders to UPS facilities to answer questions.

The new contract scores some significant wins for the union, including eliminating a two-tier wage system for drivers. It also calls for the company to put air conditioning in new trucks for its drivers, who have raised growing concerns about the risk of working long hours in vehicles that reach dangerously high temperatures in extreme heat.

UPS earlier this month reported a sharp decline in revenue and profit for the second quarter, triggering job cuts as it also navigated the contentious labor contract talks and faced the threat of a strike.

UPS CEO Carol Tomé told investors that customers shifted more packages to competitors than expected, as the strike threat heated up over the summer.

UPS moves about 6% of U.S. GDP, “and there was no place for this volume to go. So we avoided a disruption to the economy” with the agreement, Tomé said.