The man who robbed and killed a sleeping Detroit firefighter with a gym weight was sentenced to 40 to 80 years in prison on Wednesday.

Timmy Lynn Soto, 33, struck David Madrigal with a heavy workout plate as the firefighter was sleeping in his own home on Dec. 19, 2015.

“I apologize to the family for what I did,” Soto said in court. “I know I was wrong. I wasn’t in the right state of mind.”

From left, Timmy Lynn Soto, Nicole O’Neill, and Christian Rasnick.

Soto, of Detroit, was invited to have drinks with Madrigal at his home in Detroit. One of the c0-defendants, Christian Rasnik, said the plan was to rob the 59-year-old firefighter, not kill him.

Soto said he became enraged when Madrigal allegedly began “hitting on” another co-defendant, Nicole O’Neill. Soto and O’Neill left the house to buy drugs, and when they returned, Madrigal was sleeping in a chair.

Soto stuck Madrigal on the head twice with a gym weight, killing him.

Police said the trio stole a safe that contained two guns and $1,500 in cash before setting Madrigal’s truck on fire.

“There’s no words to explain what the world is missing now,” Madrigal’s daughter Christina Madrigal said before sentencing. “He was 59 and taken way too early.”

Rasnik, who pleaded guilty to second-degree murder, is scheduled to be sentenced Thursday.

O’Neill is headed to a jury trial on charges of armed robbery, third-degree arson and larceny in a building.

Madrigal was planning to retire after serving 26 years with the Detroit Fire Department.