President Barack Obama on Tuesday addressed Donald Trump’s warnings about voter fraud. And he did so by making the kind of argument that might actually get under Trump’s skin.

The president told Trump to “stop whining” and suggested the GOP nominee lacks the fortitude to be president.

It happened in the Rose Garden, during a joint press appearance with Italian Prime Minister Matteo Renzi. A reporter asked Obama a question about Trump’s repeated predictions that Hillary Clinton’s supporters would try to steal the election by casting fake ballots, registering non-citizens, and other sorts of illegal activity in cities with large minority populations that tend to vote Democratic.

Trump has been making these warnings more loudly and more frequently in the last few weeks, as his prospects for winning the election have dimmed. A wide swath of political leaders, including some prominent Republicans, have condemned his arguments because they lack basis in fact and because they undermine faith in American democracy.

Obama made these points too, calling Trump’s voter fraud arguments “unprecedented” for a major party candidate in modern history. But he also said that Trump’s focus on voter fraud revealed something about Trump’s character ― and fitness for office.

“It doesn’t really show the kind of leadership and toughness you want in a president,” Obama said. “You start whining before the game is even over? If whenever things are going badly for you, and you lose, you start blaming somebody else? Then you don’t have what it takes to be in this job.”

Obama pointed backwards, at the Oval Office, as he said that ― and he wasn’t done. “There are a lot of times when things don’t go our way. Or my way. That’s OK. You fight through it, you work through it, you try to accomplish your goals.”

“I’d advise Mr. Trump to stop whining and go try to make his case to get votes,” Obama said.

And if Trump were to succeed, and win in November? Then, Obama promised, he would do his best to ensure a smooth transfer of power, just as he expected Clinton would do.

“That’s what Americans do, that’s why America is already great,” Obama said, ironically appropriating Trump’s “Make America Great” slogan. “One way of weakening America and making it less great is if you start betraying those basic traditions that have been bipartisan and have helped to hold together this democracy now for well over two centuries.”