Maryland Gov. Larry Hogan, who is weighing a primary challenge to President Trump, drew a sharp contrast with the president’s anti-media rhetoric Monday, telling a crowd of hundreds at a journalism awards banquet in downtown Washington that he respects reporters and their “noble profession.”

“You may not always get it right, but you are not fake news,” Hogan (R) said to applause at the banquet for the Toner Prize for Excellence in Political Reporting.

Referencing another of Trump’s favorite attacks against the media, Hogan told the gathering of political reporters that “you are not the enemy of the people. And it is that kind of dangerous rhetoric that threatens to undermine and erode the trust between the people and the very institutions that are the cornerstone of our democracy.”

Hogan, a moderate who was easily reelected to a second term last year, called for civility in public discourse, emphasizing many of the same themes that helped make him a popular figure in a state dominated by Democrats.

“Those of us blessed by your trust should give you a government that appreciates that no one of us has all the answers or all the power,” he said. “A government that tolerates contrary views among a diverse citizenry without making them into enemies or doubting their patriotism.”

Since his inauguration in January, Hogan has warmly received the courtship of some GOP leaders seeking an alternative to Trump.

The governor has acknowledged that a primary challenge right now appears politically impossible, given Trump’s overwhelming support within his party. But he says he would consider jumping into the race if the president’s base weakens. And he has increasingly ventured onto the national political stage this year after spending the past four years mostly avoiding it.

In his speech Monday, Hogan praised reporters and said they “represented one of America’s most important and all too often underappreciated professions.”

He described rushing to the scene of the June 28 shooting rampage at the Capital Gazette newspaper in Annapolis, where five employees were killed. The suspect had a long-standing grudge against the newspaper.

Hogan praised the newspaper’s surviving reporters for continuing to work outside the crime scene tape and covering the massacre of their colleagues.

The Toner awards honor the late New York Times writer Robin Toner, the first woman to be a national political correspondent for the newspaper. It is sponsored by the Newhouse School at Syracuse University, Toner’s alma mater. Toner died in 2008 of cancer, a disease that Hogan also has battled.

This year’s political reporting prize went to Jason Zengerle for his writing in the New York Times and GQ magazines. Fact-checkers Glenn Kessler, Salvador Rizzo and Meg Kelly of The Washington Post and Isaac Arnsdorf of ProPublica were given honorable mentions.

Past keynote speakers at the awards ceremony include President Barack Obama in 2016 and Hillary Clinton. Former Ohio governor John Kasich, a moderate Republican, also was a speaker. Hogan was invited to ensure that the awards ceremony highlighted speakers from both sides of the aisle, said Peter Gosselin, Toner’s husband and a journalist at ProPublica.

On Monday, Hogan repeatedly alluded to Trump without mentioning the president.

“The biggest crisis facing our nation isn’t a wall between Mexico and the United States,” he said, but a wall that divides discourse in America.

Hogan also said Americans are weary of a government in which “insults substitute for debate, recriminations for negotiation, and gridlock for compromise.”

“I believe that you should be able to have confidence in the character and civility of the people you elect to office, regardless of their party affiliation,” he said.

The governor’s speech noted that his father’s place in history was documented by the Washington political press corps during the Watergate scandal. Lawrence Hogan Sr., then a representative from Maryland, was the first GOP congressman to vote to impeach President Richard M. Nixon.

The elder Hogan taught at the University of Maryland earlier in his career, his son said.

Hogan characterized his relationship with the Maryland press corps as sometimes spirited but said that he “always had the greatest respect for the journalists.”

“I know that this is a difficult and challenging time for your profession,” Hogan said. “Faith and confidence in the media is nearly as low as it is for elected officials. Welcome to the club.”

This story has been updated to include that the Toner award is sponsored by the Newhouse School at Syracuse University.