A Texas inmate who claimed he had an intellectual disability in a bid to avoid execution was given a lethal injection on Wednesday, 12 years after admitting to fatally stabbing his wife and two stepsons and raping his two stepdaughters.

Robert Sparks, 45, told investigators he killed his wife and 9- and 10-year-old stepsons and raped his 12- and 14-year-old stepdaughters because his family had been poisoning him and a voice told him to kill his family. He asked to be tested for poison, and for the two girls to undergo polygraph tests.

This undated photo provided by the Texas Department of Criminal Justice shows Robert Sparks. (Texas Department of Criminal Justice via AP)

Sparks received a lethal injection at the state penitentiary in Huntsville, Texas. He became the 16th inmate put to death this year in the U.S. and the seventh in Texas. Seven more are scheduled for execution this year in Texas, the country’s busiest capital punishment state.

HOURS-OLD BABY FOUND IN SUITCASE NEAR DUMPSTER; POLICE RELEASE PICTURES OF LUGGAGE

“I am sorry for the hard times. And what hurts me is that I hurt y'all ... even y'all, too,” Sparks told family members who watched through death chamber windows.

“I love you all. … I feel it,” he said. He was pronounced dead 23 minutes later.

Prosecutors said Sparks first stabbed his wife, then-30-year-old Chare Agnew, 18 times as she lay in her bed. He then went into the bedroom of his stepsons, Harold Sublet Jr. and Raekwon Agnew, took them separately into the kitchen, and stabbed them. Raekwon had been stabbed at least 45 times.

He then proceeded to rape his stepdaughters.

COSTCO SHOOTING: OFF-DUTY LA OFFICER WON'T FACE CHARGES

Sparks' lawyers fought until the end to have him exempt from the death penalty on grounds of intellectual disability. A psychologist hired by Sparks’ attorneys said last month in an affidavit that he “meets full criteria for a diagnosis of" intellectual disability. The Supreme Court in 2002 barred execution for mentally disabled people but states have their own discretion over how to determine intellectual disability.

His attorneys said that at the time of the trial, Sparks was not deemed intellectually disabled, but updates to the handbook used by medical professionals to diagnose mental disorders would have changed that.

CLICK HERE FOR THE FOX NEWS APP

The U.S. Supreme Court also denied a request by Sparks’ attorneys to stop the execution; they alleged the jury had been improperly influenced because an officer had worn a necktie with a syringe on it, indicating he supports the death penalty.

The attorney general’s office said the jury foreperson said she never saw the tie and did not believe it influenced jurors.

The Associated Press contributed to this report.