Authorities say that the Muslim man who was fatally shot by Boston police on Tuesday was plotting to behead a police officer in a terror attack.

Officials say that Usaama Rahim, 26, threatened officers with a military-style knife after they tried to question him around 7 a.m. on Tuesday outside a CVS Pharmacy in Roslindale. In response, an FBI agent and Boston cop opened fire when he failed to comply with police orders and drop the weapon, said Boston police Commissioner William Evans.

As a result, Rahim was shot twice and died at a local hospital.

Following the shooting, officials revealed that the Joint Terrorism Task Force placed the suspect under 24-hour surveillance for several weeks after he made statements about killing a police officer. Police say that there is also evidence that he had planned to carry out a terror attack against a cop.

"We believe the intent was to behead a police officer," an official told the Boston Globe Wednesday morning. "We knew the plot had to be stopped. They were planning to take action Tuesday."

Although Commissioner Evans announced that surveillance video supports the police account of the events leading up to the shooting, Rahim's brother, a prominent Muslim leader, said that Rahim was waiting at a bus stop on his way to work when the shooting broke out.

"He was confronted by three Boston Police officers and subsequently shot in the back three times," Imam Ibrahim Rahim wrote in a Facebook post, reports The New York Daily News. "He was on his cell phone with my dear father during the confrontation needing a witness. His last words to my father who heard the shots were: I can't breathe!"

The video has not yet been released to the public.

Massachusetts State Police and Boston police have also arrested an Everett, Massachusetts man named David Wright in connection with Rahim's alleged plot, reports USA Today.