BOSTON (WPRI) — The Boston man shot Tuesday by authorities and the man arrested shortly after were planning beheadings as part of jihad, according to court documents released Wednesday.

In the complaint filed against David Wright of Everett, Usaamah Rahim, 26, bought several military fighting knives on Amazon with the purpose of beheading police officers. The documents said investigators believed the attack was imminent, either June 2 or June 3.

According to court complaint, Wright – who had his first court appearance at the federal courthouse in Boston Wednesday afternoon – agreed to waive his Miranda Rights following his arrest and agreed to speak with FBI agents.

He was ordered held on a charge of conspiracy with intent to obstruct the federal investigation of Usaamah Rahim.

Wright was taken into custody Tuesday, hours after Boston police and FBI agents shot and killed Rahim, who they said was under 24-hour surveillance by members of a Joint Terrorism Task Force.

According to court documents, Wright, Rahim and a third person met on a beach in Rhode Island on Sunday, May 31 to discuss their plans. According to the complaint, Wright told agents the trio discussed plans to behead someone out of state.

While the court documents did not name the third person, Target 12 confirmed the FBI and State Police searched a home in Warwick in connection with the Boston terror investigation. As of Wednesday afternoon, the FBI confirmed no one was arrested or in custody in connection with the Warwick case.

A few days after Sunday’s meeting, court documents say Rahim called Wright at 5 a.m. Tuesday, telling him he was changing his plans. Instead of carrying out an attack in another state, he reportedly told Wright he was going to “go after” the “boys in blue” instead, telling him “I can’t wait that long. I can’t wait that long man.”

“Yeah, I’m going to be on vacation right here in Massachusetts….I’m going to go after them, those boys in blue. Cause, as, it’s the easiest target and the most common is easiest for me,” Rahim reportedly told Wright.

The agent who filed the complaint wrote that “vacation” was code for committing violent jihad.

Before hanging up, Wright allegedly urged Rahim to prepare a will and destroy his laptop and cell phone.

About two hours after that reported 5 a.m. phone call, Rahim would be dead after a confrontation with police and FBI agents.

Believing he would soon carry out his plan, authorities approached Rahim Tuesday morning. At that time, police said Rahim lunged at the officers with a military knife they believe he purchased last month. When he refused to drop his weapon, authorities shot and killed him.

Boston Police Commissioner Bill Evans said the officers and FBI agents approached Rahim because they felt he posed a real threat, but they did not expect him to react as he did.

David Wright faces a maximum penalty of five years in prison if convicted.