She was adept at hiding her pregnancies. At 14, she went into labor with her first baby before her mother even knew she had conceived a child. A year later, prosecutors say, she secretly gave birth to a second baby, this time in the bathtub of her apartment. That baby has disappeared.

The Brooklyn teenager kept yet another pregnancy secret from her family, giving birth in October 2013 in the bathroom of a friend’s apartment in Queens. The birth came to light only because the next day, she and her friend were arrested on shoplifting charges at the Victoria’s Secret store in Manhattan’s Herald Square. A security guard, smelling a faint rotten odor, found a dead 8-pound boy in her tote bag, along with a stolen pair of pants.

The grisly discovery prompted a long investigation, and on Thursday, nearly two years later, the young woman, Tiona Rodriguez, 18, of Crown Heights, Brooklyn, was charged with murder, having turned herself in to the authorities Thursday morning. Appearing in State Supreme Court in Manhattan and addressing the judge in a faint voice, she pleaded not guilty. Justice Thomas Farber ordered her held without bail.

“She planned and carried out the murder of her newborn infant and then callously shoved him in a bag,” Rachel Ferrari, an assistant district attorney, said during the bail hearing. She added that Ms. Rodriguez had sent a message to a friend saying she intended to “dig a hole, put it somewhere, lol, then we go eat IHOP.”