Image copyright AP Image caption Community leaders were shown a video of the shooting

Two men were plotting to behead police officers when one was killed and another arrested in Boston on Tuesday, according to the FBI.

David Wright and Usaama Rahim met a third man on a beach on Sunday to discuss the plot to target police.

Two days later police arrested one of the men at home, after shooting another in a car park while trying to to question him.

Mr Wright is charged with attempting to destroy criminal evidence.

Rahim purchased several large knives online, and intended to behead a "planned victim in another state" according to the FBI complaint.

Early on Tuesday morning Rahim called Mr Wright to inform him that the plan had changed and he now intended to "go after" the "boys in blue" according to coded conversations recorded by the FBI.

Investigators believe "boys in blue" was code for Boston police officers.

Two hours later Usaama Rahim, 26, was shot and killed while under surveillance by counter-terrorism officers.

Police say Rahim attacked officers with a large knife after being approached by five officers in the residential Roslindale neighbourhood.

He was shot three times and later died in hospital.

The chairman of the House Homeland Security Committee said Rahim had been "communicating with and spreading ISIS [Islamic State] propaganda online".

"These cases are a reminder of the dangers posed by individuals radicalised through social media," said Michael McCaul.

Image copyright AP

Image copyright Reuters Image caption Police and FBI agents raid a nearby home and arrested a terror suspect

Police screened a video of the attack, captured by surveillance cameras, to local religious and community leaders on Wednesday afternoon.

Imam Abdullah Faaruq called the video "inconclusive" since it doesn't show how the encounter began.

But he said it confirmed that Rahim was not shot in the back by the five officers.

Image copyright Reuters Image caption A home in Everett was raided and a man arrested

Iman Ibrahim Rahim, a religious leader in San Francisco, had said his brother was shot in the back while waiting for a bus to bring him to his job.

Rahim had worked for CVS since March but previously was a security guard, for a time employed at the Islamic Society of Boston Cultural Center.

An investigation will be conducted by Boston Police and the FBI to determine if the shooting was justified.

David Wright was arrested later on Tuesday after a raid at his home in Everett, Massachusetts.

Authorities also searched a home in Warwick, Rhode Island, but officials refused to say confirm it was linked to the Boston investigation.