A 21-year-old university student who was taken hostage in her apartment and then shot to death during a police standoff with an armed robber on New York’s Long Island was killed by a bullet fired from an officer’s gun, investigators said on Sunday.

Andrea Rebello was shot in the head on Friday by one of eight rounds fired at Dalton Smith, who had the woman in a headlock with a 9mm gun pointed at her head at the time, Nassau County Police Department spokesman James Imperiale said.

Smith, 30, was struck by seven bullets and died in the apartment in Uniondale, about a half a mile (800 meters) from Hofstra University. Rebello, who was studying public relations at Hofstra, was taken to a nearby hospital where she later died.

Investigators determined that Smith, who had an extensive criminal history and had been released from prison earlier this year, did not fire his gun during the incident, Imperiale said.

Nassau County Police Commissioner Thomas Dale traveled to Tarrytown, New York, on Saturday to inform Rebello’s parents that their daughter had been killed by an officer’s bullet.

“He sat down with them and went over the findings,” Imperiale said. “The whole situation is completely tragic.”

Smith entered Rebello’s apartment about 2:20 a.m. (0620 GMT) on Friday, brandished his gun and demanded money and valuables from the student and her three roommates, including her sister, Imperiale said.

Smith then told one of the roommates to go to an ATM and withdraw money, according to police. That roommate left and immediately called police, according to Imperiale.

When police arrived, Rebello’s sister answered the door and ran out of the apartment, he said.

“He pushed the male (roommate) down the stairs. The roommate comes crashing down the stairs ... and jumps behind a sofa,” Imperiale said.

According to Imperiale, Smith came down the stairs with Rebello in a headlock and the gun pointed at her head, saying “I’m going to kill her. I’m going to kill her.” He then used her as a human shield as he attempted to flee the rear of apartment, the spokesman said.

“He raised his weapon at the officer and officer was forced to fire,” Imperiale said.

Students graduating from Hofstra on Saturday wore white ribbons in memory of Rebello, according to the local media.

“A young member of the Hofstra family has been taken from us in a senseless act of violence,” Hofstra President Stuart Rabinowitz said in a statement.

The school also flew flags at half-staff to honor Rebello. A candlelight vigil was held on Saturday night at the school, located in Hempstead, about 30 miles (48 km) east of New York City.

The officer who fired the shots during the standoff was on leave as the department continued its investigation, Imperiale said.