When Philadelphia police disclosed two years ago that the man accused of shooting an officer claimed to do so "in the name of Islam,"  the already shocking crime received international attention — and led to questions about whether the gunman had been inspired or directed by a terrorist organization.

For the first time Wednesday, Edward Archer's own words after the crime were aired publicly and in full — leaving little doubt that in his own mind at least, Archer's faith motivated the ambush-style attack on Officer Jesse Hartnett in West Philadelphia.

"I pledge my allegiance to the Islamic State," Archer told a detective hours after he allegedly shot Hartnett in January 2016, according to a video recording of his interrogation shown to jurors at Archer's trial. In the same interview, the defendant told the detective that he needed to "fight the disbelievers" of Islam, and that when he pulled the trigger, he "thought about Allah."

Excerpts of the three-hour-long interrogation video, shown during the seventh day of Archer's criminal trial, marked the final piece of the prosecution's case against him.

The was-it-or-wasn't-it-terrorism question has lingered in the background of the case almost since its outset.

In the weeks after the crime, then-FBI Director James Comey said authorities had not discovered any evidence linking Archer to foreign terrorist organizations. The Delaware County man, now 32, has never been charged with a terrorism-related count. And the day after the crime, Archer's mother said her son had been "talking to himself" and hearing voices — leaving open the potential that Archer may have been affected by mental illness.

But his court-appointed lawyers were denied in their bid to have him declared incompetent to stand trial, and he has routinely refused to cooperate with them — at times refusing even to respond to questions from the judge and court staff. The recorded interrogation therefore stands as his most expansive explanation of the night's events.

Recorded beginning around 4:30 a.m. on Jan. 8, 2016, at Police Headquarters, it showed a calm and seemingly aloof Archer repeatedly citing his religion when discussing the shooting with Detective John Harkins — but often mumbling or refusing to answer more basic questions, such as what type of gun he fired or what he was wearing at the time of the crime.

Harkins, for his part, seemed skeptical that Archer's actions were motivated by dogma. Pressing Archer on his claimed motive, Harkins pointed out that surveillance video had captured the incident and showed Archer covering his face, wearing gloves, opening fire, then running away — steps taken by gunmen in even the most unremarkable shootings.

"It just doesn't strike me as religious conviction," Harkins told Archer in the video. "It's more angry criminal violence that happens every day."

But Archer only seemed interested in discussing his religious inspiration. At one point, after Harkins asked why Archer was outside late on a January night, Archer responded: "The main thing I want to be clear is: I pledge my allegiance to the Islamic State."

Because Archer has refused to cooperate with his attorneys, Trevan Borum and Michael Coard, in forming a defense strategy, the defense rested Wednesday without offering any witnesses or further explanation about his motives.

Closing arguments are expected to begin Thursday before Common Pleas Court Judge Leon W. Tucker. If convicted of counts including attempted murder and aggravated assault, Archer could spend the rest of his life behind bars.