A 26-year-old man who had been under 24-hour surveillance by anti-terrorism investigators was shot dead Tuesday morning outside of a Roslindale CVS after allegedly threatening a Boston Police officer and an FBI agent with a machete.

Boston Police Commissioner William B. Evans said officers tried their best to get Usaama Rahim to put down the knife, but “unfortunately, they had to take a life.’’

“We believed he was a threat,” Evans said at a press conference Tuesday afternoon. “He was someone we were watching for quite a time. The level of alarm brought us to question him today. I don’t think anybody expected the reaction we got out of him.”

Evans said Rahim refused to back down after police repeatedly asked him to put down the weapon, which was described as a large, military knife.

Rahim was reportedly on foot and was stopped near the CVS parking lot on Washington Street in Roslindale at 6:59 a.m. The two were forced to fire at him after he continued toward them with the knife. 

He was rushed to Brigham’s and Women’s Hospital where he was pronounced dead from his injuries.

Authorities wouldn't disclose detailed information on why the terrorism force was following him. 

“I can tell you that our investigation is still ongoing," Boston FBI Special Agent in Charge Vincent Lisi is quoted as saying in a Boston Globe report. "There’s a lot more for us to do.”

Suffolk District Attorney Daniel F. Conley said his office was looking into whether the officer and agent were justified in using deadly force. The incident was caught on surveillance video, Conley said, though as of deadline the video had not been publicly released. The footage shows that Rahim was the aggressor, he said.

Neither suffered any physical injuries, police said.

Later Tuesday, Rahim's older brother, Ibrahim Rahim, posted a message on Facebook saying: “We are deeply grieved by the loss of my younger brother. While we understand the need for information. We ask that the press give us time to grieve. We will have a statement once we have met as a family.”

That same afternoon, investigators raided a home on Linden Street in Everett that was reportedly in connection with the case. Reporters were turned away from the scene, which was blocked off by investigators.