Police say 47-year-old Carlos Rivera, of Lawrence, was arrested early Saturday and charged with indecent assault and battery on a child and distribution of drugs to a minor.
The 13-year-old girl was publicly identified by her family as Chloe Ricard, of Amesbury.
The Essex district attorney's office says she was pronounced dead shortly after being brought to the emergency room Monday.
Authorities say Rivera allegedly brought her there, along with another girl who had also been at his apartment.
The medical examiner hasn't yet ruled on the cause and manner of death.
Rivera is being held on $750,000 bail.
It's unclear whether he's represented by an attorney who could comment on his behalf.
Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.