A man has been charged with murdering an 8-year-old boy – because he thought the child was gay.

Isauro Aguirre killed his girlfriend's son, Gabriel Fernandez, in a rage-fuelled attack after the boy told him to leave his mother.

Los Angeles Prosecutor Jon Hatami accused Aguirre of torturing the child before killing him in 2013.

Hatami said on Monday (16 October) that Aguirre and the boy's mother Pearl Fernandez beat, whipped and burned Gabriel with cigarettes.

He accused the couple of shooting the child with a BB gun, feeding him cat litter and keeping him bound and gagged.

He said that the couple's 911 call was an attempt to "cover up what they did". The boy died from serious injuries two days after being taken to hospital.

Aguirre made Gabriel dress up in girl's clothes and thought the boy was gay, the prosecutor said.

"This wasn't about drugs. This wasn't about mental health issues. [Aguirre] did it because he didn't like him ... he believed Gabriel was gay and to him that was a bad thing ... he did it out of hatred of a little boy," Hatami said.

"He was a security guard who intentionally tortured and abused a helpless and innocent little boy," he added.

Aguirre's defence lawyer John Allan told the court that his client was "guilty of murder" but said the evidence showed that he "never intended for Gabriel to die". He stressed that Aguirre should not have been charged with a special circumstance allegation of torture that could result in a death penalty sentence.

The trial continues.