Amazon CEO Jeff Bezos, who typically tries to stay out of the political fray, mounted a vigorous defense of press freedom on Thursday evening, saying President Donald Trump should be glad to face media scrutiny.

The remarks came during an hour-long, freewheeling conversation with hedge fund billionaire and philanthropist David Rubenstein at an annual gathering of the Economic Club of Washington, which Rubenstein leads. After discussing the success of the Washington Post, which Bezos bought in 2013, Rubenstein asked how Bezos responds to criticism — some of which comes from Trump's Twitter feed — of Amazon (AMZN) and the Post.

"I don't feel the need to defend Amazon," Bezos said. "But I will say this: I do think it's a mistake for any elected official to attack media and journalists."

"There's no public figure who's ever liked their headlines. It's okay. It's part of the process," Bezos said. "What the president should say is, 'This is right, I'm glad I'm being scrutinized.' That would be so secure and confident."

Demonizing the media and calling them "the enemies of the people" is dangerous, Bezos said.

"We live in a society where it's not just the laws of the land that protect us. It's also social norms that protect us. And every time you attack that, you're eroding it a little bit around the edges," he said.

The remarks were met with applause from the well-heeled audience, which was double the club's typical attendance.

Many were eager to hear any hint of where Bezos had decided to put Amazon's second headquarters, with multiple locations surrounding the national capital in contention. The dinner was sponsored by a coalition funded by local developers to advocate for more affordable housing in the region. Bezos was in town with his parents, who run the Bezos Family Foundation.

Attendees included Maryland Gov. Larry Hogan, Washington Mayor Muriel Bowser, the head of the General Services Administration, the Postmaster General and other local dignitaries. Virginia Gov. Ralph Northam was scheduled to attend, but couldn't because of the approach of Hurricane Florence. Instead, he sent his economic development director.

Bezos disappointed them all, saying only that he would make a decision on the location of the new headquarters by the end of the year.