A Barnard College student was stabbed to death in an upper Manhattan park Wednesday by a group of men who had tried to rob her, police sources said.

Freshman Tessa Majors, 18, was discovered by a school security guard inside Morningside Park near West 116th Street and Morningside Drive around 5:30 p.m., according to the sources.

She had been beaten and stabbed by a group of three or four men at the base of some stairs.

“Tessa was just beginning her journey at Barnard and in life,” college president Sian Leah Beilock said in a statement Wednesday night.

“We mourn this devastating murder of an extraordinary young woman and member of our community.”

Police investigating the crime scene found a trail of blood indicating that Majors had tried to make her way back up the park stairs toward Morningside Drive, the sources said.

Preliminary information suggested that Majors was stabbed several times in the face, neck and under her arm.

She apparently had put up a fight when the men tried to rob her, the sources added.

A security guard post was nearby, but the sources said the guard was on patrol at the time of the stabbing.

Majors was transported to Mount Sinai St. Luke’s Hospital, where she died.

Police found the woman’s cellphone nearby, which was how she was identified.

Beilock called the murder “an unthinkable tragedy that has shaken us to our core.”

She added, “Please know that we are all grieving together and I am thinking of you as we process this awful news as a community.”

She added that she had spoken to Majors’ parents, who were on their way to New York from their home in Virginia.

Barnard students were being shuttled around in campus security vehicles late Wednesday.

“This is so horrible. When you hear about the stuff, that’s the shock,” said Tristen, a student teacher at the school, who declined to give his last name. “That’s crazy if it’s just a robbery. I can’t imagine any way to justify this.”

Another student, who is from France, said the school had warned people about the dangers of going into the park.

“During the day it’s fine, but they tell us to be careful at night,” the student told The Post.

Students gathered on campus past midnight, hugging and crying early Thursday.

Some posted comments on Majors’ Instagram page.

“I miss you already,” Lexi Phelan wrote.