MIAMI GARDENS, Fla. — President Obama joined a parade of Democrats on Thursday in rebuking Donald J. Trump for threatening not to abide by the results of the election. But he saved his thorniest barbs for Senator Marco Rubio, the Florida Republican who endorsed Mr. Trump after labeling him a “dangerous con artist” during their bitter primary battle.

“How can he call him a con artist and dangerous, and object to all the controversial things he’s said, but then say, ‘I’m still going to vote for him?’” Mr. Obama said to a boisterous crowd at a Hillary Clinton rally at a historically black college in this swing state.

“C’mon, man,” he said.

“That is the sign of someone who will say anything, do anything, pretend to be anybody just to get elected,” said Mr. Obama, as he praised Representative Patrick Murphy, who is waging an uphill battle to unseat Mr. Rubio. “If you’re willing to be anybody just to be somebody, man, you don’t have the leadership that Florida needs in the United States Senate.”

Mr. Obama’s assault on Mr. Rubio showcased the president’s determination to broaden his indictment of Mr. Trump into an indictment of the Republican Party, parts of which continue to support the nominee, even after a calamitous few weeks in which he was heard speaking about women in crudely sexual terms in a 2005 recording and then declared in his debate with Mrs. Clinton on Wednesday that he might not accept the voters’ verdict on Election Day.