Image copyright AP Image caption The new federal courthouse in Salt Lake City was opened last week

A man accused of robbery and assault was shot and killed 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 he had rushed towards the witness with a pen in an "aggressive, threatening manner".

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.

Image copyright Reuters Image caption Siale Angilau was the last of 17 people to be tried in the 2010 case

"It was kind of traumatising," Sara Jacobson, his daughter, said.

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, Mr Cardwell said.

Media playback is unsupported on your device Media caption Perry Cardwell, who was in court with his daughter, said that the incident was over very quickly

US District Judge Tena Campbell declared a mistrial, writing in her order that members of the jury were visibly shaken and upset.

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.