President Trump expressed his sorrow over the attack that claimed five lives at an Annapolis, Maryland, newspaper Thursday. 

A gunman with an apparent years-long vendetta against the Annapolis Capital-Gazette opened fire in the newsroom, killing five employees. Police responded within a minute and took the shooter into custody.

"I'd like to address the horrific shooting that took place yesterday at Capital Gazette newsroom. ... Journalists, like all Americans, should be free from the fear of being violently attacked while doing their job," Trump said Friday at the White House at an event marking six months since the passage of tax reform. 

He said the attack "shocked the conscience of our nation and filled our hearts with grief."

Michael Moore: We Have to 'Put Our Bodies on the Line' to Stop Trump

GOP Candidate Says Country Club Cancelled Her Event Because of Her Support for Trump

Trump said there "are no words to express our sorrow" over the loss of life, vowing that his administration "will not rest until we have done anything in our power to reduce violent crime and protect innocent life."

"We will not ever leave your side. ... Horrific, horrible thing," he concluded. 

Authorities said the shooter, Jarrod W. Ramos, explicitly targeted the Maryland newspaper after losing a 2012 defamation suit against the company and looked around the newsroom for specific victims. 

The five Gazette staffers killed in the attack were identified as editor Wendi Winters, writer John McNamara, editorial page editor Gerald Fischman, sales assistant Rebecca Smith and assistant editor and columnist Rob Hiaasen.

Watch the president's comments above.

Tomi Lahren: The 'Loving and Tolerant Left Is Anything But' That

Co-Chair of Women for Trump Receives Death Threats After CNN Appearance

Cruz: 'Good Possibility' Hillary Would Have Won If Scalia Had Not Died Before Election

Hannity Rips 'Never-Trumpers' as Second SCOTUS Spot Opens