Siale Angilau, a man accused of robbery and assault, was shot dead in a Salt Lake City court after he lunged at a witness giving evidence.
Siale Angilau, 25, died in hospital after being shot several times by a US marshal in front of the jury at the new federal courthouse.
The FBI said Siale Angilau had rushed towards the witness with a pen in an “aggressive, threatening manner”.
Siale Angilau was the last of 17 accused gang members tried as part of a 2010 case.
The case included 29 counts, including assault, conspiracy, robbery and weapons offences.
Perry Cardwell, who was in the courtroom with his adult daughter, told the Associated Press news agency at least six shots were fired.
The witness on the stand at the time was not identified and was not injured.
He appeared to be in his mid-20s and was testifying about gang initiation, Perry Cardwell said.
US District Judge Tena Campbell declared a mistrial, writing in her order that members of the jury were visibly shaken and upset.
Siale Angilau’s lawyer declined to answer questions as he left the court on Monday. The accused had been transferred to federal custody last week after serving time in prison in Utah on other charges.
The new federal courthouse in Salt Lake City opened just a week ago. It was designed with several security features, including bulletproof glass in some areas and separate routes in and out for judges, prisoners and the public.
The building was closed for a while after the shooting but later reopened.
[youtube QXMG6DWSVvM 650]