(CNN) -- A standoff between Boeing and thousands of unionized workers based in Washington state came to an unexpected end Friday after workers voted in favor of a contract to build the company's new commercial jet.
The deal keeps economic activity worth billions inside the state, and means hundreds of thousands of jobs will be retained.
The vote Friday, from the International Association of Machinists District 751, came in at 51% to 49%. It was a dramatic reversal in the machinists' stance, after they had overwhelmingly rejected a similar contract less than two months ago.
The new contract, which will run from 2016 to 2024, means an end to the traditional pension plan for more than 33,000 machinists at Boeing, replacing it with a 401(k) type of plan.
The plan had been a sticking point, but fear of losing jobs and work connected to the jet prompted members to change their minds. Union representatives told media they didn't like the position, but were forced to accept it.
Local union officials had pointed to the loss of the pension as the prime reason to reject the deal, also arguing that approving the contract would encourage the company to make continued threats to move work elsewhere in the future in order to win other concessions.
However, IAM International leadership had argued the new offer was better than one that was rejected last year, adding about $1 billion in value to members. The improvements include an additional $5,000 bonus in 2020 and the continuation of the current formula for how new hires move up the pay scale.
Jim Bearden, speaking on behalf of the local union president,Tom Wroblewski, said, "Our members have spoken, and having said that, this is the course we'll take. No member liked this or the position we were put in by the company."
"We faced tremendous pressure from every source imaginable," Bearden said. "Politicians, the media, and others, who truly had no right to get into our business, who were aligned against us."
Ray Conner, chief executive officer of Boeing Commercial Airplanes, said in a statement that the 777X and the composite wings would now be built in the Puget Sound area, where the company's plants are based.
"Thanks to this vote by our employees, the future of Boeing in the Puget Sound region has never looked brighter," he said.
The 777X is Boeing's answer to the Airbus A350-900/1000, which competes with Boeing's current 777 Classic series of jet airliners.
The 777 Classic is assembled at Boeing's production plant in Everett, Washngton, near Seattle. The Classic's metal wings are built in Japan, shipped to Everett and joined to the fuselage at the Boeing plant.
Production of the 777X will begin in 2016, with a first flight due in 2018 before it goes into service in 2020. The jet will use carbon-composite wings, which are regarded as the plum of the program.
State officials had pulled out all the stops to win the program. Gov. Jay Inslee said losing the 777X to another state would be the beginning of the end of Boeing's production in Washington, where the company employs nearly 90,000 and drives another 270,000 indirect jobs.
Elected officials and others believed that losing the 777X and the composite wings would mean future airplanes would follow the 777X to other states.