Photo via Instagram.

Photo via Instagram.

A Nassau County (N.Y.) Police officer who fatally shot a Hofstra University student and her armed captor during a standoff has struggled to deal with the accidental death, according to a police source close to the officer.

Andrea Rebello, 21, died early Friday along with 30-year-old Dalton Smith, who had broken into the student's Uniondale home where she lived with several other students. Smith entered the home wearing a ski mask and took Rebello hostage. Two of the students escaped and called 911. Police arrived 10 minutes later.

Two Nassau County officers responded. One entered the house and confronted Smith, who held Rebello in a headlock, reports CBS New York. Smith pointed the gun at Rebello's head and repeatedly threatened to kill her. He then pointed the gun at the officer. The officer acted quickly because he believed his and Rebello's life were in danger, police sources told CBS New York.

The responding officers may not have been aware that Smith had hostages in the home, reports the New York Times.

The 42-year-old Nassau cop, a 12-year agency veteran and former NYPD officer, is said to be inconsolable over Rebello's death, reports the New York Post. "He blames himself and keeps replaying it in his mind," a police source told the Post. "He is torn up about the poor girl." The officer has been placed on medical leave.

Smith has a lengthy criminal history and had been wanted since April for absconding from parole. His criminal record includes armed robbery and automobile theft convictions, reports the Post.