Canadian Prime Minister Justin Trudeau on Thursday offered his condolences to the victims of a deadly shooting at a Maryland newspaper, calling the event "devastating."

"Journalists tell the stories of our communities, protect democracy, & often put their lives on the line just to do their jobs," Trudeau wrote in a tweet.

"Today’s attack in Annapolis is devastating. Our hearts go out to all the victims & their families."

Journalists tell the stories of our communities, protect democracy, & often put their lives on the line just to do their jobs. Today’s attack in Annapolis is devastating. Our hearts go out to all the victims & their families. — Justin Trudeau (@JustinTrudeau) June 29, 2018

Trudeau's statement came just hours after a gunman opened fire at the Capital Gazette newsroom in Annapolis, Md., leaving five people dead and others wounded.

ADVERTISEMENT

Acting Anne Arundel County police chief William Krampf said during a press conference that the lone gunman was in custody and being interviewed by authorities.

The suspect was identified in reports as 38-year-old Jarrod Ramos. It was revealed that Ramos sued the Capital Gazette in 2012 for defamation. The case was thrown out by a judge.

President Trump Donald John TrumpBiden on Trump's refusal to commit to peaceful transfer of power: 'What country are we in?' Romney: 'Unthinkable and unacceptable' to not commit to peaceful transition of power Two Louisville police officers shot amid Breonna Taylor grand jury protests MORE tweeted earlier Thursday that he was briefed on the situation before leaving Wisconsin after an event, writing, "My thoughts and prayers are with the victims and their families. Thank you to all of the First Responders who are currently on the scene."

Prior to departing Wisconsin, I was briefed on the shooting at Capital Gazette in Annapolis, Maryland. My thoughts and prayers are with the victims and their families. Thank you to all of the First Responders who are currently on the scene. — Donald J. Trump (@realDonaldTrump) June 28, 2018

White House press secretary Sarah Huckabee Sanders also condemned the shooting, tweeting that a “violent attack on innocent journalists doing their job is an attack on every American.”

Thursday's shooting in Maryland led police forces in cities such as Los Angeles, New York City and Boston to have officers conduct patrols near major media outlets.

In a telephone interview Thursday night on CNN, Selene San Felice, a reporter at the Capital Gazette, that the attack left the newsroom "shattered."