There was a struggle, and one of the attackers pulled out a knife and stabbed Ms. Majors several times, he said. The attackers fled and Ms. Majors staggered up a flight of stairs, out of the park and onto the street, where a school security guard found her and called 911.

She was taken to Mount Sinai St. Luke’s hospital, where she died from her injuries, he said.

“We lost a very special, very talented, and very well-loved young woman,” her family said in a statement on Thursday. “Tess shone bright in this world, and our hearts will never be the same.”

Ms. Majors’s parents were on their way to New York, the police said. Her father, Robert Inman Majors, is a novelist and teaches creative writing at James Madison University.

The park where Ms. Majors was killed is in a Harlem precinct that has grown safer over the years, but residents have raised concerns about persistent safety issues in the park — even as the neighborhood around it improved, and playgrounds and ball fields replaced patches that were once strewn with crack vials.

Earlier this year, several people reported that they had been approached from behind in the park and punched by young people.

Assaults overall have fallen slightly over the last year in the precinct, but police data shows that robberies have increased, with many of the victims targeted for personal electronics. As of Dec. 8, there had been 20 robberies inside Morningside Park or on its perimeter this year, compared to seven in the same period last year.

Since June, five people reported being robbed on or near the staircase at 116th Street and Morningside Drive, near the spot where Ms. Majors was killed. Recently, the police said, several teenagers had been arrested in a pattern of robberies in the area.