WASHINGTON -- The president of one of the largest labor unions to endorse Sen. Bernie Sanders says it's time to rally behind Hillary Clinton and keep Donald Trump out of the White House at all costs.

In a speech to union members in D.C. on Tuesday, Chris Shelton, president of the 700,000-member Communications Workers of America, said that while Clinton is not a "perfect candidate," she is the candidate the union needs to get behind immediately.

"Bernie is not going to be the nominee. Hillary Rodham Clinton will be," Shelton said. "And whatever you think of Secretary Clinton -- I happen to think she was a damn good senator from New York and that a lot of the hostility against her is attributable to out-and-out sexism and to the 'vast right-wing conspiracy' -- she is the candidate who is running against Donald Trump. And brothers and sisters, we must stop Donald Trump from becoming president."

Clinton has already secured the delegates she needs and is expected to be named the Democratic nominee next month at the party's national convention.

Most national labor unions endorsed Clinton for president. But a handful of them, including CWA, instead opted to back Sanders, a self-described democratic socialist who's been an ally of organized labor throughout his congressional career. Many progressives within labor have been skeptical of Clinton due to her evolving position on the Trans-Pacific Partnership and her lack of support for a $15 federal minimum wage, among other issues. Shelton's predecessor as CWA president, Larry Cohen, went so far as to formally join the Sanders campaign.

The Clinton vs. Sanders struggle within organized labor has been testy at times. But Shelton's speech was just the sort of reconciliation that Clinton backers want from a pro-Sanders union after an often-bruising primary. Democrats rely heavily on unions for their electoral ground game, and the Clinton campaign would hope to see a united front from labor in the general election.

While saying Clinton is "not [the] populist" they would prefer, Shelton noted that she stood with the union on the Verizon picket line, sponsored the Employee Free Choice Act as a senator and backs comprehensive immigration reform.

"Donald Trump is a mindless jerk who threatens to destroy our country," he said. "Hillary Clinton is a thoughtful and experienced leader with whom we have sometimes had disagreements. It’s a no-brainer."

In an interview, Shelton told The Huffington Post that backing Clinton now was "the only course," and that the union would be putting its money and get-out-the-vote efforts behind her candidacy.

"Trump is out telling people what they want to hear, not necessarily what he believes," Shelton said. "You hear he's against TPP, against trade deals, but then he makes his ties and all his other junk in Mexico and China, and does everything he can to make sure jobs are sent overseas rather than in this country."