Vermont Sen. Bernie Sanders could have become a revered figure in contemporary politics had he not "sold out to the devil" by endorsing Hillary Clinton, Donald Trump said at a rally on Thursday.

"You know, if Bernie hadn't made this deal and just done something where he maybe just did nothing and just went away, he would have been a legendary character," the Republican presidential nominee told supporters in Bedford, N.H., miles away from where Sanders and Clinton had campaigned together on Wednesday.

Sanders shocked Democrats early on in his bid for the White House after he began attracting tens of thousands of voters to his campaign events and edging Clinton in polls among women and millennials. He came within inches of beating the former secretary of state in Iowa's Democratic caucus, carried 60 percent of the vote in the New Hampshire primary and won 22 additional states before conceding that he couldn't flip enough superdelegates to win the nomination.

"He would have been a legendary political figure," Trump said. "But the deal he made with Hillary was not the right thing and it wasn't representative of what he should have done to his people."

After a hard-fought primary, Sanders endorsed Clinton just before the Democratic National Convention in July. The 74-year-old socialist has since used his widespread appeal among millennials to woo youth voters, many of whom have been eyeing third-party candidates, to throw their support behind Clinton.

But Trump predicted that many Sanders supporters will decide to back him on Nov. 8, noting that he and the Vermont senator both oppose free trade agreements.

"We're going to have a lot of Bernie people supporting us, especially because of my views on trade," he said.