The Queens man accused of stabbing his wife and their two young daughters to death in a jealous rage over photos of the mother with another man has pleaded guilty to manslaughter charges in exchange for less jail time, authorities say.

Miguel Mejia-Ramos was initially charged with first- and second-degree murder and criminal possession of a weapon in the January stabbings of his 21-year-old wife, Deisy Garcia, and their 1- and 2-year-old daughters.

Mejia-Ramos fled New York after the slayings and was arrested in Texas a short time later after authorities tracked his cellphone.

Prosecutors had said Mejia-Ramos stood over his sleeping wife and two daughters with a knife after seeing a photo of Facebook of Garcia and another man. Garcia awoke and screamed, and he stabbed her as she got out of bed and ran to another room, prosecutors said. Mejia-Ramos grabbed another knife and stabbed her multiple times in the torso, chest and back, they said.

After stabbing Garcia, Mejia-Ramos went back to the bedroom where 2-year-old Daniela and 1-year-old Yoselin lay, prosecutors said. He picked up Daniela, gave her a hug and a kiss, asked for forgiveness, then put her back on the bed and killed her, prosecutors said.

He then did the same with Yoselin, they said.

Mejia-Ramos will be sentenced to 45 years in prison at a hearing next month.