The young woman, Saoirse Kennedy Hill, 22, was the daughter of Courtney Kennedy Hill. She was at the compound where her grandmother, Ethel Kennedy, 91, lives when emergency responders were called on Thursday afternoon, the family friends said.

One of the first officers on the scene said that a patient was in cardiac arrest, according to the Hyannis News. The woman, whose identity was not immediately released by the authorities, was taken to Cape Cod Hospital in Hyannis, where she was pronounced dead.

“Early this afternoon Barnstable police responded to a residence on Marchant Avenue in Hyannis Port for a report of an unattended death,” said Tara Miltimore of the Cape and Islands district attorney’s office. “The matter remains under investigation by the Barnstable police as well as state police detectives assigned to the Cape and Islands district attorney’s office.”

Before enrolling in Boston College, where she was a communication major and vice president of the College Democrats, Kennedy Hill wrote about her struggles with depression and mental illness for the student newspaper at Deerfield Academy, a private preparatory school in Massachusetts, in 2016.

The Kennedy compound on Cape Cod is the storied summer residence of one of America’s most enduring political dynasties. The overdose adds to a litany of tragedies that have befallen the Kennedys and taken on the grim aura of a family curse.