During his eight years in office, Barack Obama hasn’t always been seen as a robust supporter of a free press.

His administration’s aggressive attempts to uncover confidential sources, secretly subpoena phone records of news organizations, prosecute whistleblowers under the Espionage Act, and forbid government officials from speaking to reporters, didn’t exactly endear him to the Fourth Estate.

But in his final White House press conference as president on Wednesday, Obama did his level best Tto undo his successor’s endless efforts to delegitimize the institution of journalism, and deliver a ringing defense of its vital role in a healthy democracy.

“America needs you and our democracy needs you,” Obama said in his opening statement in the jam-packed briefing room in the West Wing.

“We need you to establish a baseline of facts and evidence that we can use as a starting point for the kind of reasoned and informed debates that ultimately lead to progress. And so my hope is that you will continue with the same tenacity that you showed us, to do the hard work of getting to the bottom of stories and getting them right and to push those of us in power to be the best version of ourselves and to push this country to be the best version of itself.”

Those sentiments could hardly have been a more pointed rebuke to president-elect Donald Trump’s incessant slander of working journalists—including in his Wednesday morning Twitter rant, in which he bitterly complained about NBC News’s “totally biased” reporting—as “dishonest…scum” and “the lowest form of life.”

“More FAKE NEWS,” Trump tweeted about a Today show segment that pointed out that he doesn’t deserve credit for saved jobs at General Motors, Lockheed and other companies.

The only time Obama used the phrase “fake news” was a reference later in the press conference to the Republicans’—and, by implication, Trump’s—claims of rampant voter fraud.

“You’re not supposed to be sycophants, you’re supposed to be skeptics, you’re supposed to ask me tough questions,” Obama told the standing-room-only crowd. “You’re not supposed to be complimentary, but you’re supposed to cast a critical eye on folks who hold enormous power and make sure that we are accountable to the people who sent us here, and you have done that.”

He added: “And you have done it for the most part in ways that I could appreciate for fairness, even if I didn’t always agree with your conclusions.”

And in case the incoming Trump administration is planning, as rumored, to kick beat reporters out of their longtime office space in the West Wing and relocate them to the Old Executive Office Building or somewhere even farther away, the current president came down solidly on the side of the press.

Obama said, “having you in this building has made this place work better. It keeps us honest, it makes us work harder. You have made us think about how we are doing what we do and whether or not we’re able to deliver on what’s been requested by our constituents. And for example, every time you’ve asked why haven’t you cured Ebola yet or why is there still that hole in the Gulf, it has given me the ability to go back and say, 'Will you get this solved before the next press conference?’”

For President Obama, of course, there won't be a next press conference.