A Rutgers University student was killed by a black bear over the weekend, the police said on Monday, the first such recorded death in New Jersey.

The student, Darsh Patel, 22, and four friends were hiking on Sunday in the Apshawa Preserve in the northern part of the state, about 40 miles from New York City. They encountered a black bear, which began to follow them, according to the police in West Milford, a township that includes the preserve.

The friends told the police they scrambled to get away from the bear, all running in different directions. Four of the men later found one another, and they called the police to help search for their missing friend, according to the authorities. Mr. Patel’s body was found about two hours later.

“Evidence at the scene indicated that the victim had been attacked by a bear,” the West Milford Police Department said in a statement.