A man was sentenced to life in prison Thursday after being convicted of fatally shooting two workers at a Dallas hospital last year as he argued with his girlfriend, who had just given birth to their child.

Nestor Hernandez, 31, was found guilty of capital murder in the October 2022 shooting deaths of Jacqueline Pokuaa, 45, a social worker, and Katie Annette Flowers, 63, a nurse, at Methodist Dallas Medical Center. He received an automatic sentence of life without the possibility of parole. Prosecutors didn't seek the death penalty.

Defense attorneys had asked jurors to consider a lesser charge, acknowledging that Hernandez opened fire but saying he didn’t mean to kill anyone. Taking the stand at the trial, Hernandez admitted to shooting the two women but said it was an accident.

DALLAS HOSPITAL SHOOTING SUSPECT HAS LENGTHY CRIMINAL HISTORY: POLICE

Texas Fox News graphic

Hernandez was on parole for robbery and had permission to be at the hospital while wearing an ankle monitor. (Fox News)

TWO HOSPITAL EMPLOYEES KILLED IN SHOOTING AT TEXAS HOSPITAL, SUSPECT HAD ANKLE MONITOR

Dallas County District Attorney John Creuzot told jurors that Hernandez went to the hospital that day with "rage, resentment, anger and a plan to kill." Prosecutor George Lewis said Hernandez was motivated by a belief that his girlfriend had cheated on him and he wasn’t the baby’s father. During the trial, prosecutors presented evidence that he was.

Hernandez's girlfriend, Selena Villatoro, testified that he accused her of infidelity and hit her with a pistol. She said he threatened to kill her, himself and anyone who came into the room, and when Pokuaa then entered, Hernandez shot her.

Hernandez testified that as he and Villatoro fought, Pokuaa tried to intervene and the gun misfired. He said he then shot into the hallway in a panic, striking Flowers.

TEXAS STATE FAIR IN DALLAS EVACUATED OVER SHOOTING, 3 INJURED: POLICE

Hernandez was shot in the thigh by a hospital police officer who arrived on the scene.

At the time of the shooting, Hernandez was on parole for aggravated robbery and had been granted permission to be at the hospital while wearing an ankle monitor.