NEW YORK—A nanny accused in the stabbing deaths of two children in her care at their upscale home near Central Park pleaded not guilty Wednesday inside a hospital room where she is being treated for self-inflicted stab wounds.

Yoselyn Ortega, lying handcuffed in her hospital bed in silence, her right hand trembling, entered the plea through her defence attorney.

Attorney Valerie Van Leer-Greenberg also told Judge Lewis Bart Stone that her client needed constant medical care.

“My client . . . sustained serious medical injuries and mental trauma,” she said. “She is in a very debilitated condition.”

The judge, like two prosecutors and everyone else crowded into the room, wore a hospital gown and a blue hair net. He ordered Ortega held without bail while she undergoes a psychiatric exam.

Ortega, 50, appeared alert but didn’t speak during the 10-minute hearing. The judge placed her on suicide watch.

Ortega, who’s from the Dominican Republic, had a neck brace and a tube leading to her throat but breathed on her own.

The unusual bedside arraignment came as District Attorney Cyrus Vance Jr. announced an indictment charging Ortega with multiple counts of murder.

“This crime shocked and horrified parents around the city, many of whom entrust their children to the care of others both by necessity and by choice,” Vance said in a statement.

Authorities allege that on the evening of Oct. 25, while the children’s mother was out with a third child, Ortega repeatedly stabbed 6-year-old Lucia Krim and her 2-year-old brother, Leo Krim.

When their mother, Marina Krim, returned home with her 3-year-old daughter, she found their bodies in the bathtub, with Ortega lying on the bathroom floor with stab wounds to her neck, authorities said. A kitchen knife was nearby.

Some of Ortega’s friends and relatives said she had appeared to be struggling emotionally and financially before the murders.