Hillary Clinton on Thursday won the endorsement of the AFL-CIO, the nation's largest labor federation, in another sign of her consolidation of the Democratic party heading into next month's convention.

The AFL-CIO's general board voted to endorse Clinton over Vermont Sen. Bernie Sanders, a move that had been expected after Clinton secured enough support among delegates to become the presumptive Democratic nominee.

"Hillary Clinton is a proven leader who shares our values," said AFL-CIO President Richard Trumka in a statement. "Throughout the campaign, she has demonstrated a strong commitment to the issues that matter to working people, and our members have taken notice."

Clinton won the endorsements of many of the AFL-CIO's largest members in the past year, including the American Federation of State, County and Municipal Employees and the American Federation of Teachers, paving the way for the AFL-CIO to back her campaign.

While Sanders' list of union endorsements is shorter, he had the support of a vocal group of rank-and-file union members who were drawn to his opposition to past trade deals and calls for a $15 an hour minimum wage.

Sanders' support within labor circles contributed in part to the AFL-CIO's decision to withhold its endorsement during the primaries. But labor leaders have been coalescing around Clinton. In a speech this week to his members, the president of the Communications Workers of America, which endorsed Sanders, said it was time to get behind Clinton.

"Bernie is not going to be the nominee. Hillary Rodham Clinton will be," said Chris Shelton, CWA's president, adding "and whatever you think of Secretary Clinton ... she is the candidate who is running against Donald Trump."

The labor federation represents 12.5 million members and is a potent force in Democratic politics and voter turnout. Union leaders have been gearing up for a general election showdown against Republican Donald Trump, whom they portray as a threat to working families but fared well among blue-collar voters during the GOP primaries.

"This election offers a stark choice between an unstoppable champion for working families and an unstable charlatan who made his fortune scamming them," said Lee Saunders, the president of AFSCME and the chair of the AFL-CIO political committee.

Labor's role in the debate over foreign trade could be crucial in the fall campaign.

Trump has denounced "stupid" trade deals that hurt U.S. workers, a message that could have resonance in labor-heavy Rust Belt states that have been in the Democratic column in past elections such as Pennsylvania, Michigan and Wisconsin.