Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

President Donald Trump hit back once again at his detractors, advising cadets at the U.S. Coast Guard Academy to never give up in the face of adversity and calling out media for unfair treatment.

"Over the course of your life, you will find that things are not always fair," Trump said at the commencement in New London, Connecticut. "You'll find that things happen to you that you don't deserve and that are not always warranted, but you have to put your head down and fight, fight, fight."

LIVE BLOG: Comey Memo Has Trump White House in Tailspin

During the address, Trump did not directly mention the latest controversy engulfing his administration over his firing of FBI Director James Comey.

Instead, Trump lashed out at the press and his critics.

"Look at the way I've been treated lately, especially by the media. No politician in history...has been treated worse or more unfairly," he said.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

He added that he was not elected to serve the Washington media, but the "forgotten men and women of our country" that ushered Trump to power in November.

"You can't let them get you down," he said. "You can't let the critics and the naysayers get in the way of your dreams."

Trump was preceded on the stage by Department of Homeland Security Secretary John Kelly who urged graduates repeatedly to "tell the truth" to their superiors even if they don't want to hear it.

"Even though it's uncomfortable, even though they may not want to hear it" they deserve the truth, he said, adding that America is a "nation of laws."

Trump's speech echoed themes he espoused at Liberty University days earlier, where he bashed "critics" and the Washington D.C. establishment "who think they know everything."

Throughout Trump's campaign for office, he routinely doubled down in the face of controversy and critical questions from the media. During Wednesday's speech, Trump continued that trend and used a larger bully pulpit to counterpunch his critics.

"Adversity makes you stronger," he said Wednesday. "Don't give in, don’t back down, and never stop doing what you know is right."

Wednesday's speech comes amid new revelations that according to a memo kept by the former FBI Director, the president urged Comey to drop the investigation into former National Security Adviser Michael Flynn. A source close to Comey confirmed to NBC News Tuesday that the memo included a line in which Comey quoted Trump as having said, "I hope you can see your way clear to letting this go, to letting Flynn go."

The White House has denied that Trump intervened to ask Comey to stop the investigation, calling it "not a truthful or accurate portrayal of the conversation between the president and Mr. Comey."

"While the president has repeatedly expressed his view that General Flynn is a decent man who served and protected our country, the president has never asked Mr. Comey or anyone else to end any investigation, including any investigation involving General Flynn," a White House official told NBC News.

During Wednesday's commencement ceremony, Trump was seated near Connecticut Gov. Dannel Malloy. The two politicians shook hands at the start of the ceremony.

Last year, Trump criticized Malloy as doing a bad job as governor by saying "speaking of garbage."