Somebody thinks the sword is mightier than the pen.

President Donald Trump's head of Homeland Security joked "use that on the press, sir," after the president was presented with a ceremonial saber during the U.S. Coast Guard Academy commencement Wednesday afternoon.

"Yeah, that's right," Trump laughed in response to Department of Homeland Security Secretary John Kelly's caustic quip about the sword at the New London, Connecticut, campus.

During his commencement speech to graduating Coast Guard cadets, Trump took a verbal swipe at the press.

"Look at the way I have been treated lately, especially by the media," he said. "No politician in history, and I say this with great surety, has been treated worse and more unfairly. You can't let them get you down, you can't let the critics and the naysayers get in the way of your dreams."

Kelly's joke about attacking reporters and Trump's chuckle at it come a day after The New York Times revealed that former FBI Director James Comey had written a memo describing how Trump asked him in February to drop a probe of ousted national security advisor Michael Flynn's ties to Russia.

The Times story also said that "Mr. Trump began the discussion by condemning leaks to the news media, saying that Mr. Comey should consider putting reporters in prison for publishing classified information, according to one of Mr. Comey's associates."

The Times story on Tuesday night was quickly corroborated by a number of other media outlets, including NBC News. The White House has denied the claims.

The bombshell report was just the latest in a weeklong series of media stories that prompted sharp criticism of Trump. Those stories included ones detailing how Trump allegedly gave Russia's foreign minister classified information from Israel about a terror plot by ISIS during a meeting in the Oval Office in the White House.

Trump and his allies have repeatedly complained that he is the victim of "fake news" stories.

The First Amendment of the U.S. Constitution bars Congress from, among other things, "abridging the freedom of speech, or of the press."

According to the Committee to Protect Journalists, 48 journalists were murdered around the world in 2016.

One of those murders occurred in the United States, which since 1992 has seen only nine killings of journalists. A freelancer named Jacinto Hernández Torres was fatally shot last June in a suburb outside Dallas and Fort Worth, Texas.

La Estrella, the Spanish-languge publication of the Fort Worth Star Telegram, "confirmed that at the time of his death Torres was working on a story about Mexican professionals who had migrated to the United States and were now working in construction, restaurants, and service-sector jobs," according to the Committee to Protect Journalists.

The committee's website says that since 1992, 80 journalists have been killed in Russia.

Correction: An earlier version of this story misstated the number of journalists murdered worldwide in 2016, as reported by the Committee to Protect Journalists. The correct number is 48.