President Trump said his "thoughts and prayers" were with the victims of the shooting outside the Capital Gazette newsroom in Annapolis, Maryland, Thursday afternoon.

The president also thanked the first responders.

Vice President Pence shared similar sentiments online, tweeting that he is "praying for the victims and their families" as he monitors the "horrific shooting" from Guatemala.

As reports of the shooting unfolded, lawmakers took to social media to urge for an "end [to] the violence." At least five people died in the shooting, officials said. Anne Arundel Sheriff Ron Bateman told Fox News a suspect is in custody.

Maryland Gov. Larry Hogan, a Republican, said he was “absolutely devastated” by the tragedy.

“Praying for those at the scene and for our community,” he continued.

“My heart is with the families, friends and loved ones of the victims as we learn more about this terrible situation,” Sen. Chris Van Hollen, D-Md., said on social media. “We must unite to end the violence.”

Van Hollen also reached out to Phil Davis, a Capital Gazette reporter who had tweeted, "There is nothing more terrifying than hearing multiple people get shot while you're under your desk and then you hear the gunman reload."

In a tweet, Van Hollen encouraged Davis to "stay strong."

"Phil, I can't imagine what you and the entire Capital Gazette team are going through right now. Journalists shouldn't have to fend off bullets in the newsroom while doing their jobs -- this is not normal," the senator wrote.

Ben Cardin, Maryland’s other Democratic senator, expressed his gratitude for the first responders and said his “heart is with Capital Gazette and the people of Annapolis.”

Rep. Steny Hoyer, D-Md., also thanked first responders on social media.

"The senseless attack on a Maryland newspaper today is sickening," House Speaker Paul Ryan tweeted. "God bless these journalists. We pray for them and their families tonight."

House Minority Leader Nancy Pelosi immediately called on Congress “to take action to prevent the tragedy of gun violence.”

“Every day it fails to do so is a stain on our country,” Pelosi said. She also expressed her prayers for those impacted by the shooting.

Rep. Elijah Cummings, D-Md., expressed his thoughts of the victims and their families.

"We have had to witness far too many of these atrocities, and it is time to put an end to them," he said. "I will continue to monitor the scene, and ask you all keep the victims in your prayers."

“Once again a group of Americans are confronted by gun violence. Congress must act,” said Sen. Bob Casey, D-Pa. “Members of the press here and abroad risk their lives to report the truth; we must respect that vital role that a free press plays in making democracy function.”

Rep. Jamie Raskin, D-Md., said he was “praying for the safety of everyone in the [Capital Gazette] family.”

“I am deeply saddened by reports of a shooting at [Capital Gazette],” Rep. John Sarbanes, D-Md., said on Twitter. “My thoughts are with the paper’s staff and their families at this difficult time.”

Democratic Rep. Anthony Brown, also of Maryland, said he was monitoring the situation and promised to share more details as he receives them.

“My prayers are with the victims and their loved ones as we continue to learn more about this horrific act of violence,” Rep. Martha Roby, R-Ala., said.