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.
QXMG6DWSVvMThe US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…