President Barack Obama says Donald Trump needs to “stop whining” about the election.

“One of the great things about America’s democracy is that we have a vigorous, sometimes bitter political contest,” Obama said Tuesday during joint news conference with Italian Prime Minister Matteo Renzi at the White House. “And when it’s done, historically, regardless of party, the person who loses the election congratulates the winner, confirms our democracy and we move forward. That’s how democracy survives.”

Obama said the Republican nominee ought to realize “there’s something more important than any individual campaign.” Trump has spent the last week railing against the media, asserting that the November election is “rigged” and claiming that the press is involved in a conspiracy orchestrated by his Democratic rival, Hillary Clinton

“I have never seen in my lifetime or in modern political history any presidential candidate trying to discredit the elections and the election process before votes have even taken place,” the president continued. “It’s unprecedented.”

Related: Trump has long been making wild claims about election fraud

Obama said Trump’s claims about voting irregularities and improprieties at polling stations are baseless.

“Every expert, regardless of political party, regardless of ideology, conservative or liberal, who has ever examined these issues will tell you that instances of significant voter fraud are not to be found,” the president said, noting that elections are run by state and local officials. “There is no serious person out there who would suggest somehow that you could even rig America’s elections, in part because it is so decentralized.”

“In Florida, for example, you’ve got a Republican governor who’s got Republican appointees who are gonna be running and monitoring a whole bunch of these election sites,” Obama said. “The notion that somehow if Mr. Trump loses Florida it’s because of ‘those people’ you have to watch out for? That is both irresponsible and, by the way, doesn’t really show the kind of leadership and toughness that you’d want out of a president.”

Story continues

Obama added: “I’d invite Mr. Trump to stop whining and go try to make his case to get votes.”

Also read: Bill O’Reilly to Donald Trump: ‘Stop whining’

The president also said he’s alarmed by Trump’s repeated praise for Russian President Vladimir Putin.

“Mr. Trump’s continued flattery of Mr. Putin and the degree to which he appears to model many of his policies and approaches to politics of Mr. Putin is unprecedented in American politics,” Obama said. “It is out of step not just with what Democrats think but out of step with what up until the last few months almost every Republican thought including some of the ones who are now endorsing Mr. Trump.”

In an interview Monday, Trump said Russia “can’t stand” Obama and Clinton, and said if elected he would consider a possible meeting with Putin before his inauguration as president of the U.S.

Obama mocked Republican leaders who were “constantly haranguing us for even talking to the Russians” yet are now supporting Trump’s willingness to work with Moscow.

“Mr. Trump rarely surprises me these days,” the president said. “I’m much more surprised and troubled by the fact you have Republican officials who historically have been adamantly anti-Russia and in fact have attacked me for even engaging them diplomatically, now supporting, in some cases echoing, his positions. It’s quite a reversal.”