An ex-felon has been sentenced to 112 years to life for his second-degree murder conviction for fatally shooting a transgender woman while trying to collect a debt from her in a Hayward motel room two years ago.

Alameda County Superior Court Judge Roy Hashimoto pronounced the harsh sentence against Miguel Inostroz, 31, who has prior convictions for burglary and robbery, at a hearing on Thursday.

Inostroz's lawyer, James Giller, admitted during Inostroz's trial in July that Inostroz fatally shot James "Lucie" Parkin at the La Quinta Inn on Hesperian Boulevard in Hayward on Sept. 20, 2011.

But Giller claimed that the shooting was an accident and sought a lesser verdict of involuntary manslaughter, which would have carried a lighter sentence.

Prosecutors said Inostroz and five other companions, who they said all have methamphetamine histories, were staying at the motel and Parkin, a pre-op transgender man who wanted to be referred to as a woman, came there after one of Inostroz's companions asked her to give them a ride.

Once Parkin arrived, Inostroz confronted her over the money she owed him and she removed $30 from her bra but Inostroz struck the top of her head with the handle of his revolver and pulled her by her hair, prosecutors said.

One of Inostroz's companions tried to intervene by pulling the arm in which Inostroz carried his gun but Inostroz fired his revolver and shot Parkin in the back, prosecutors said.

However, Giller argued that Inostroz didn't intend to shoot Parkin and the gun went off only because the companion pulled on his arm.

Giller said the fact that Parkin was a transgender woman wasn't a relevant factor in the incident.

In addition to convicting Inostroz of second-degree murder, jurors convicted him of assault with a firearm for striking Parkin with his gun and of being a felon in possession of a gun.

Prosecutor Danny Lau had sought a first-degree murder conviction for Inostroz.

Giller said the reason Inostroz received a lengthy prison sentence is that he's a "three strikes" defendant since he's been convicted of three serious criminal offenses.