Miguel Ramos-Mejia, 28, was charged with six counts of first- and second-degree murder and criminal possession of a weapon in the deaths of 21-year-old Deisy Garcia, 2-year-old Daniela Mejia and 1-year-old Yoslin Mejia.
He was ordered held without bail. The judge granted a defense request for protective custody and suicide watch.
Garcia and the two children were brutally stabbed to death inside their Jamaica apartment shared with his uncle's family last week.
Prosecutors say Mejia-Ramos killed his wife and children after seeing a Facebook picture of Garcia with another man. The couple was in the process of getting separated.
Mejia-Ramos had been out drinking at a friend's house on Sunday night, prosecutors said. When he returned home around 11 p.m., he rifled through his wife's phone and Facebook account and found an image of her with another man, they said.
He snapped, grabbed a knife from a butcher block and stood over his sleeping wife, Deisy Garcia, and two daughters, they said. Garcia awoke and screamed, and he stabbed her as she got out of bed and tried to run to another room, prosecutors said. Mejia-Ramos grabbed another knife and stabbed her multiple times in the torso, chest and back, they said.
According to investigators, Mejia-Ramos saw Daniela had woken up. He picked her up, hugged and kissed her, asked for forgiveness, and then stabbed her to death. Investigators say he did the same with Yoselin.
When asked if he killed the children, Mejia-Ramos said planned to take the kids with him, but he told investigators that he didn't have any car seats.
Authorities said Mejia-Ramos told detectives that he tried to hang himself with a cord in the room.
When that failed, he took a shower, grabbed $240 from Deisy's bag and then snuck out of the house and drove off in a white van.
He was arrested in Texas, apparently trying to cross the border into Mexico, and flown back to New York.
Queens District Attorney Richard Brown said he met with friends and family of the victims.
"Everyone is, of course, devastated by that which occurred," he said. "I assured them that this case will be vigorously prosecuted and there will be no plea bargaining."
Mejia-Ramos was charged with six counts of first-degree murder and faces life in prison without parole if convicted.