Ronald W. Hamilton, left, and his son Ronald Hamilton, who was convicted of killing his wife and a police officer in 2016. (Family photo)

A Virginia jury could not agree on whether to impose a death sentence for Ronald Hamilton, who killed his wife and a Prince William police officer — a deadlock that resulted in a sentence of life in prison without parole for the former Pentagon IT specialist.

On Thursday, the Prince William County jury of 10 women and two men told the judge it was unable to settle on a punishment on one of Hamilton’s two capital murder convictions; the jury did unanimously agree to give Hamilton a life sentence without parole for the premeditated killing of a police officer. The jury’s decisions ended a capital murder trial that began in mid-September and included emotional testimony from the mothers of the slain women and from Hamilton’s father — a retired police commander — who pleaded for his son’s life.

In a brief interview immediately after Judge Steven S. Smith’s announcement of the jury’s deadlock, Commonwealth’s Attorney Paul Ebert said he was disappointed.

“There’s nothing worse than having a police officer killed in the line of duty,” he said. He added that “some people think twice” before killing police, which is why he seeks the death sentence as a deterrence.

On the night of Feb. 27, 2016, Hamilton, 34, shot and killed his wife, Crystal Hamilton, and Ashley Guindon, who was on her first shift as a Prince William police officer. The Hamiltons, whose relationship was floundering, got into a heated fight that night — Crystal, 29, wanted to go out with friends to an adult male entertainment club, and he insisted she stay home.

He threw her up against a wall, and, after she called 911, he pulled out a handgun and shot her multiple times, while their then-11-year-old son, Tyriq Hamilton, was nearby in their two-story brick home in Woodbridge.

As Prince William police officers descended on the house, Ronald Hamilton emerged with an AK-47, spraying shots and killing Guindon and wounding two other officers, Dave McKeown and Jesse Hempen. He was arrested shortly afterward.

Months later, Hamilton’s attorneys offered a deal in which he would plead guilty to a first-degree murder charge and receive a life sentence with the possibility of geriatric parole. After that was rejected, Hamilton agreed to plead guilty to capital murder with life in prison without parole. That, too, was turned down. Instead, Ebert, known for the high number of death-sentence victories in his 50-year career, sought the harshest punishment possible.

After the jury gave Smith a note indicating they were deadlocked 6 to 6, prosecutors did not give up. They urged him to tell the jury to continue deliberating so they could come up with a unanimous decision. Ed Ungvarsky, one of Hamilton’s attorneys, fought back, saying such a move was intended as “dynamite” to “coerce” the jury into a decision.

“The jury has made it crystal clear that they can’t agree to a penalty,” Ungvarsky told the judge. “No one [should] force a juror to give up a conscientiously held decision.”

Smith agreed, declaring, “The jury is deadlocked.”

One of Hamilton’s sisters let out a cry of relief. The mothers of the victims immediately walked out and headed to Ebert’s office for consolation.

“The jury got it wrong,” Sharon Guindon, Ashley Guindon’s mother, told NBC4’s Julie Carey. “I had that feeling that they were struggling with their decision. We didn’t think it was going to be [deadlocked] at 6-6, maybe one or two [as holdouts]. I wish they had more time.”

Guindon said she wanted Hamilton’s execution to “send a message. . . . If you kill a police officer, you are going to get death. I wanted justice for her.”

But Guindon said she was glad Hamilton’s son would not suffer through his father being executed. She suspects jurors were thinking about the boy, who is now 13 and lives in South Carolina with his father’s relatives. “At least Tyriq has his father,” she said. “As a mother, that does give me some consolation.”

Cherry Murphy, the mother of Crystal Hamilton, was distraught. “My heart is bleeding today,” she told NBC4. “I’m so broken now.”

Prosecutors, too, were upset. They had been under the impression that the jury was deadlocked on both capital murder charges. But during a late break, they learned that the jury had actually reached a unanimous verdict giving Hamilton life for Guindon’s killing.

They told the judge that the jury’s ability to come to a unanimous decision — albeit one that they opposed — was evidence that jurors could work together toward a unanimous decision and that they should have been instructed to deliberate further on the other capital murder charge. Perhaps, they thought, the six jurors who had voted for life could be swayed to choose death on the charge of killing two people in a three-year period.

In an interview with The Washington Post, Hamilton’s father, Ronald W. Hamilton, said he and his side of the family were relieved that Ronnie, as they call him, would be spared.

“We are pleased that the jury did not hand down a death sentence,” the elder Hamilton said. “We continue to pray for the families of the victims, the police officers, and the entire community.”

The younger Hamilton, who was ranked as an Army staff sergeant, was charged with 17 offenses, including three death-sentence-eligible charges of capital murder: of the premeditated killing of a law enforcement officer, of more than one person in a three-year period, and of more than one person as part of the same act.

He was convicted in September on all 17, though one of the capital murder charges was dismissed for technical reasons, making it possible that he would be sentenced only on 16. After he was found guilty and the punishment phase of the trial began, prosecutors aggressively lobbied jurors for his death, while Hamilton’s defense team implored jurors to grant him mercy.

Hamilton did not testify, though many of his friends and former military colleagues took the stand on his behalf.

During closing arguments, Ung­varsky cited the fact that Hamilton had saved a colleague’s life in an Iraq war zone while they were under attack from mortars.

But prosecutors argued that Hamilton — who had worn his Army uniform earlier in the trial — was “appropriating” the esteem of the military to manipulate jurors and divert attention from his murders.

On Thursday, Ungvarsky told reporters outside the courthouse that he was grateful for the jury’s work. “They looked inside themselves to find their own humanity,” he said, and to “find humanity” in Hamilton.