President Obama lashed out at Donald Trump and the rest of the Republican presidential field Tuesday, calling them unserious candidates who are “troubling” the world with careless rhetoric and a poor grasp of basic facts.

“I continue to believe Mr. Trump will not be president,” Mr. Obama said at a press conference in California. “I have a lot of faith in the American people. I think they recognize that being president is a serious job. It’s not hosting a talk show or a reality show. It’s not promotion. It’s not marketing. It’s hard.”

The president didn’t spare the other GOP presidential candidates from criticism, although Mr. Trump was the only one he mentioned by name. He criticized Sen. Marco Rubio, Florida Republican, for abandoning the immigration reform bill he once supported.

“You’ve got a candidate who sponsored a bill that I supported to finally solve the immigration problem, and he’s running away from it as fast as he can,” Mr. Obama said.

Being president, Mr. Obama said, “requires being able to work with leaders around the world in a way that reflects the importance of the office and gives people confidence that you know the facts, and you know their names, and you know where they are on a map.”

Referring to the entire field of GOP candidates, the president said, “They’re all denying climate change. I think that’s troubling to the international community.”

“The other countries around the world, they kind of count on the United States being on the side of science and reason and common sense,” Mr. Obama said. “They know that if the United States does not act on big problems in smart ways, nobody will. This is not just Mr. Trump. There’s not a single candidate in the Republican primary who thinks we should do anything about climate change. That’s a problem.”

Referring to Mr. Trump’s proposal to bar Muslims temporarily from entering the U.S., Mr. Obama said, “He may up the ante in anti-Muslim sentiment, but if you look at what the other Republican candidates have said, that’s pretty troubling too.”

And then Mr. Obama offered the opinion that the GOP candidates don’t have what it takes to sit in the Oval Office.

“It’s not a matter of pandering and doing whatever will get you in the news on a given day,” he said of his job. “Sometimes it requires you making hard decisions even when people don’t like it. And standing up for people who are vulnerable but don’t have some powerful political constituency.”