The public will be able to watch the execution of a former US Army major by firing squad, US Defence Secretary Pete Hegseth has said.

A Defense Department official told the BBC the execution of Nidal Hasan, who shot dead 13 unarmed US soldiers at Fort Hood in 2009, would be livestreamed.

It is believed it would be the first public execution in the US in almost a century. The decision to livestream it is “unprecedented in the modern era” and “on uncertain legal terrain,” said John Mills, a lawyer who works with inmates sentenced to death.

“People need to understand that there’s serious consequences for these types of things,” said Hegseth.

The UN human rights office told AFP that livestreaming it would be “tantamount to a public execution and would breach the absolute prohibition of torture”.

Democratic Senator Chris Murphy told CNN that the idea was “disgusting” and reminiscent of executions carried out by the Islamic State group.

The Pentagon announced earlier this week it would execute Hasan in the first military execution in more than 60 years.

Hasan, a US Army psychiatrist from Virginia, admitted fatally shooting 13 unarmed soldiers in a crowded medical building at Fort Hood.

Alonzo Lunsford, a former US Army sergeant who was shot seven times in the attack, told the BBC’s Today programme that he supported the execution by firing squad, as a method “befitting” for what he did.

He does not believe everyone should be able to watch the livestream, concerned about the message it sends younger people, but says it is important that those affected by the shooting are given the opportunity.

“As far as the families of the fallen and the families of the survivors, and the survivors themselves, yes, I think we should be able to look at it uncensored.”

Lunsford says he plans to attend the execution and before they pull the trigger he wants Hasan to look him in the eyes. “I want him to know he failed. I’m still here.”