United Parcel Service Inc.’s union workers ratified a new five-year labor agreement delivering substantial wage increases, concluding a tense period of negotiating that drove the company to the brink of a strike.

About 86% of employees voted to approve the deal, the International Brotherhood of Teamsters said Tuesday in a statement. The pact, tentatively agreed to last month, covers about 340,000 unionized UPS workers and has about $30 billion of new money, the Teamsters have said.

“This contract will improve the lives of hundreds of thousands of workers,” Teamsters President Sean O’Brien said in the statement. “Teamsters have set a new standard and raised the bar for pay, benefits, and working conditions in the package delivery industry.”

The agreement caps a volatile chapter for UPS Chief Executive Officer Carol Tomé, who managed to avoid one of the biggest threats to the company: a potentially debilitating strike. UPS is now cleaning up from the fallout, including seeking to win back customers who switched to other couriers on concern over a work stoppage. Tomé also will need to double down on efficiency measures to offset the cost of its workforce, the highest paid in the US parcel industry.

The two sides reached the tentative deal on July 25, less than a week before a strike could have begun. Under the contract, a veteran delivery driver will make $49 an hour at the end of the five-year period, bringing home about $175,000 a year in wages and benefits. Part-time workers will have a starting salary at $21 an hour, up from $15.50 in the previous contract. 

Workers also made other gains during the intense bargaining, including an additional paid holiday and a UPS commitment to have air conditioning on the new vehicles it purchases beginning next year.

UPS is expected to provide more details on the cost of the agreement now that it’s ratified.