The International Association of Machinists and Aerospace Workers is giving former Vice President Joe Biden the union’s presidential endorsement after holding a national vote by the union’s members.

Biden won 36% of the vote versus 26% for Sen. Bernie Sanders (I-Vt.). Donald Trump took 34% of ballots cast. Members were free to vote for any candidate from any party on the ballot, and members supported a Democrat over a Republican by nearly 2-1.

Voting took place in the days following Super Tuesday when Biden surged and took a lead over Sanders in delegates. Sen. Elizabeth Warren (D-Mass.) dropped out of the race in the middle of the vote, which may help explain why she netted only 2%.

The machinists union endorsement is unique in that it was done through a rank-and-file vote. At most large international unions, executive board members or other officials ultimately make the decision on which presidential candidate to back, typically after internal surveys and feedback from their members and local leaders. Many union members complain that their processes are not democratic.

EMILY KASK via Getty Images Joe Biden speaks during a rally at Tougaloo College in Mississippi on Sunday. The Democratic presidential candidate won the endorsement of the International Association of Machinists.

The IAM used to do its endorsement like other unions, but overhauled the system after the 2016 election. Like many other labor groups in that cycle, the union jumped out early for Hillary Clinton, the eventual nominee, and no doubt rankled members who preferred Sanders in that contest. Many unions are being more cautious this time around and holding back an endorsement while the primary is still contested.

The machinists union announced its new process last May and encouraged members to register to vote. The voting was overseen by an independent third party.

“Our union made it a priority in the 2020 election cycle to give IAM members a real say in who we endorse for president,” Robert Martinez Jr. said in a statement.

Here are the full results. Biden beat Bernie 36-26. And Trump got 34. pic.twitter.com/JEVu4ofFWV — Dave Jamieson (@jamieson) March 8, 2020

Martinez called Biden “a proven leader who we believe can take back the White House and restore power back to working people and unions.” The union noted Biden’s support of the Protecting the Right to Organize Act, which would overhaul labor law to make it easier for workers to form unions. The bill is a priority for organized labor and has passed the Democratic-controlled House.

But Biden has also been a supporter of the North American Free Trade Agreement and the new United States-Mexico-Canada Agreement, commonly called NAFTA 2.0. Like Sanders, the union has opposed both of those trade deals on the grounds that they make it too easy for U.S. companies to offshore jobs.

The IAM represents workers in lots of different industries, but the core of its membership is in aerospace and manufacturing, at companies like Boeing, Lockheed Martin and Harley-Davidson. The union says it has 600,000 active and retired members.

Candidates cherish union endorsements because of the ground game that often comes with them. The most active union members phone-bank and canvass for their chosen candidates, and the union’s choices can influence the way members and their families ultimately vote. Endorsements can help shape a Democratic primary if unions choose to weigh in. (The machinists union, like most labor groups, supports Democrats over Republicans by a wide margin.)

Both Biden and Sanders have picked up a handful of endorsements from large international unions, although some of the biggest prizes are still out there, like the Service Employees International Union and the American Federation of State, County and Municipal Employees. Sanders had racked up a number of endorsements from union locals in important primary states, but Biden has picked up several more as well in recent days.

The Washington Post reported Saturday that if the nomination is contested at the Democratic National Convention then several major unions will hope to play kingmaker. Four unions alone have assembled about 7% of delegates, which could give them huge influence if a nominee isn’t settled by a first ballot.

“Our union will have a lot of sway,” AFSCME President Lee Saunders told the paper.