Senator Bernie Sanders said on Friday that he will vote for Hillary Clinton in the November presidential election, offering one more indication that he has given up on his own candidacy.

Asked if he would cast his vote for Mrs. Clinton, the presumptive Democratic nominee, in an interview on MSNBC’s “Morning Joe” program, Mr. Sanders said, “Yes.”

He added that the alternative, Donald J. Trump, would be dire for the country: “The issue right here is I’m going to do everything I can do to defeat Donald Trump. I think Trump, in so many ways, would be a disaster for this country if he were elected.”

Mr. Sanders has previously signaled that he would work with Mrs. Clinton to defeat Mr. Trump, and on Wednesday he acknowledged that “it doesn’t appear” that he’ll be the Democratic nominee when the party gathers for its convention next month. But he has thus far refused to suspend his presidential bid or stop campaigning. He had a campaign rally in New York City on Thursday night, and similar events are scheduled in Albany and Syracuse on Friday.