Former President Barack Obama compared his treatment of the media to his successor's, calling President Donald Trump out for labeling the press the "enemy of the people."

Obama conceded that he was critical of media he believed treated him unfairly during his presidency, but, he argued, he never attempted to silence their voices.

"I complained plenty about Fox News, but you never heard me threaten to shut them down, or call them 'enemies of the people,'" the former president said during a rare speech on Friday.

Former President Barack Obama compared his treatment of the media to his successor's, arguing during a Friday speech that while he griped "plenty" about conservative media during his time in the White House, he never advocated for their silencing.

Obama suggested that the current president's penchant for slamming media critical of him as "fake news" and the "enemy of the people" is un-democratic and un-American.

"It shouldn't be Democratic or Republican to say that we don't threaten the freedom of the press because they say things or publish stories we don't like," Obama said during a speech at the University of Illinois, where he received an ethics in government award. "I complained plenty about Fox News, but you never heard me threaten to shut them down, or call them 'enemies of the people.'"

Political scientists and historians regularly call President Donald Trump's media bashing characteristic of authoritarian leaders, who often work to discredit the fourth estate. Republican politicians have long framed the media as the "opposition party" and worked to turn their voters against the press, but many argue Trump has taken this tactic to new heights.

"'The FAKE NEWS media is not my enemy. It is the enemy of the American people," Trump tweeted a month after taking office last year.

Meanwhile, Trump regularly praises his favorite network, Fox News, and has limited the vast majority of his media appearances to interviews with the right-leaning outlet's anchors.

Fox was on the receiving end of some presidential criticism during the Obama administration. In 2009, the Obama White House claimed that Fox was "not a news organization" and instead "a wing of the Republican Party."

Many journalists, including those at competing networks, pushed back on the Obama administration's public lashing of Fox, asserting that it is not the president's place to determine what news organizations are — or are not — legitimate.

Obama's Friday speech kicked off his move back into the political fray — the former president is planning campaign events with candidates in California, Ohio, Pennsylvania, and Illinois this month, as this year's midterm elections heat up.