HOUSTON — The Texas Court of Criminal Appeals has agreed with a Dallas County state judge’s findings and is returning a 38-year-old El Salvadoran man on death row to court for a new punishment hearing.

The state’s highest criminal court agreed Wednesday that Hector Medina’s trial lawyers were deficient for failing to present a case during the punishment phase of his 2008 trial.

Medina was condemned for fatally shooting his two small children — 3-year-old Javier and 8-month-old Diana — at their home Irving in 2007.

The court, in another North Texas capital case, has upheld the conviction and death sentence of 43-year-old Cedric Ricks.

He was convicted of fatally stabbing his 30-year-old girlfriend, Roxann Sanchez, and her 8-year-old son, Anthony Figuero, at their apartment in Bedford, in Tarrant County, in 2013.