Dallas (US), Feb 16 (AP): The man who took hostages at a Texas synagogue sought to buy drugs and a “machine gun” before the standoff last month that ended with the hostages escaping and the gunman's death, an FBI agent said in court Wednesday.

The testimony came during a detention hearing for the Dallas man accused of selling Malik Faisal Akram the handgun he used in his attack on Congregation Beth Israel in the suburb of Colleyville. A federal magistrate ordered the alleged seller, Henry “Michael” Williams, detained ahead of his trial on a charge of being a felon in possession of a firearm.

Williams, 32, was arrested less than two weeks after the standoff ended with an FBI tactical team rushing into the synagogue and fatally shooting Akram just as the hostages made their escape. Authorities said Williams confessed to selling Akram, a 44-year-old British national, the previously stolen pistol.

During the detention hearing, FBI agent Taylor Page testified that Williams said Akram initially reached out to him seeking to buy methamphetamines and “a machine gun or a weapon that contains a large number of bullets”.

Akram explained that he wanted the gun for intimidation to help settle a debt, according to Page.

Page also said that Akram fired his gun at some point during the standoff but did not provide details. Multiple gunshots could be heard in the area around the synagogue soon after the FBI breached the building.

In court, prosecutors highlighted Williams' past felony convictions and Page said Williams brokered 10 to 15 other gun sales. Williams' defence lawyer argued that he could not have known what Akram actually planned to do with the gun and said her client was being blamed for another person's actions.

Magistrate Judge Rebecca Rutherford ordered Williams be held as a potential danger to the community. (AP) SCY SCY

(This story is published as part of the auto-generated syndicate wire feed. No editing has been done in the headline or the body by ABP Live.)