Calvin Peters stabbed Levi Rosenblat, top left, in the head inside 770 Eastern Parkway, officials said. View Full Caption DNAinfo/Trevor Kapp, NYPD, and Chabad.org

CROWN HEIGHTS — Police shot and killed an emotionally disturbed knife-wielding man after he stabbed a rabbinical student in the head at the Eastern Parkway headquarters of the Chabad-Lubavitch Jewish community, the NYPD and Mayor Bill de Blasio said.

Calvin Peters, 49, had a history of psychological issues, including being diagnosed with bipolar disorder 10 years ago, and had visited 770 Eastern Parkway twice earlier Monday afternoon, officials said. He returned to the house of worship near Kingston Avenue about 1:40 a.m. Tuesday morning with a serrated 9-inch kitchen knife in hand, police said.

Once inside the building, Peters stabbed 22-year-old Levi Rosenblat, an Israeli student, in the left temple, according to a Chabad statement.

"He walked past me and went to another guy. He cornered Levi against the wall, then he stabbed him and screamed, 'I'll kill you! I'll kill you! I'll kill you!'" said witness Nathan Meir Spater, 24.

"The left side of his face was all cut up and bloody. He was screaming," said Chaim Grossbaum, a yeshiva student who was picking up a friend from 770 Eastern Parkway during the attack.

"He was conscious, but I don't think he realized how badly he was hurt," Grossbaum added.

Rosenblat was initially treated at Kings County Hospital, officials said, but was later transferred to Bellevue Hospital where he was upgraded to stable, but serious condition, according to the mayor.

State Assemblyman Dov Hikind said the yeshiva student has bleeding in the brain and will soon be joined by his mother, who is flying to New York from Israel to be with her son.

"It seems quite clear that a serious mental health problem played a role," de Blasio said Tuesday evening. "This individual is an emotionally disturbed person and we are going to be increasingly focused on the kind of mental health efforts that will help reach people earlier and better and try and keep them away from a situation where they may end up involved with law enforcement."

The NYPD's Hate Crime Task Force was investigating the stabbing after witnesses reported hearing Peters saying "Kill the Jews," officials and Chabad said. A preliminary investigation into his social media accounts did not find any evidence of hate speech, though, NYPD Chief of Detectives Robert Boyce said during the press conference.

Officers who had been posted at a nearby intersection raced into the building after a bystander came and told them what was happening, police said.

In dramatic video of the incident, Peters roamed around a darkened room filled with books shouting at nearby men, "You want me to kill you?" until officers arrived with their guns drawn.

There was a brief standoff as officer Timothy Donohue, 25, first demanded Peters drop his knife while others tried to tell the officers not to shoot, the video shows.

"You going to shoot me?" Peters asked at one point.

"If you don't drop the knife, I will," Donohue, who has been on the job three years and has not been involved in any previous shootings, according to police, replied.

Peters eventually placed the knife on a nearby table and walked away, prompting Donohue to holster his weapon and step forward, the video shows.

But as he did so, Peters then turned and snatched the blade again and lunged for the same officer, who had redrawn his gun while shouting, "Drop the f---ing knife!" according to police and the video.

Officer Roberto Pagan, 29, who had arrived with partner Officer Kevin Haniff, 29, fired a single shot into Peters' torso, police said.

Neither Pagan, who has been on the force six years, or Haniff, who has been an officer eight years, have been involved in any previous shootings.

Peters was pronounced dead at Kings County Hospital, according to the NYPD.

Witnesses said that Peters had tried to enter 770 Eastern Parkway about 5:45 p.m. Monday but was rebuffed.

"He definitely didn't look like he belonged. He stood out. He had on full casual attire and went straight for the synagogue door," said Shimon Liberow, a synagogue member.

Liberow asked if he could help Peters, to which Peters replied "No, do you have a problem?"

Other members tried to explain that the building was for Jewish religious services, so Peters asked, "Can I pray?" and when they further explained that only Jews were allowed to pray, he asked, "Can I convert?" before abruptly leaving, according to Liberow.

"He didn't look crazy like he was on drugs, but the exchange was just weird," Liberow said.

"While we are very pained by everything that has unfolded, we are very grateful to the police for their quick response," said Rabbi Motti Seligson, a Chabad spokesman, in a written statement.

"We commend the heroic efforts of the individuals who were present and took immediate action, if not for their intervention the outcome could have been, G-d forbid far worse," Seligson added. "We continue to pray for the young man who is in stable condition."

Police said the attack was likely an isolated incident, and not terror related, but they still planned to boost their presence at houses of worship throughout the city on Tuesday.

Peters was removed four times from the street as an "emotionally disturbed person" in 2001 and 2002 and had been arrested 19 times, most recently in 2006, according to Boyce.

"We spoke to the family members who said he’s been under some stress right now," Boyce said. "He is out on social security because of psychological issues."

He has been on medication since being diagnosed as Bipolar, Boyce added.

Along with the Hate Crime Task Force, the department's Internal Affairs Bureau and Brooklyn District Attorney's office were investigating the fatal police shooting, NYPD Commissioner Bill Bratton said.

"The shooting, while unfortunate, may have been unavoidable," Bratton said. He said the officers acted properly.

"They are to be commended. Particularly two of the three officers who were both at risk during the incident," the commissioner said.

Brooklyn leaders echoed Bratton's sentiment, praising the NYPD for minimizing the damage Peters could have done.

“Based on the preliminary investigation, it’s clear that the shooting was justifiable," said Borough President Eric Adams. "It was clear that this person attacked an innocent victim and it’s also clear that the necessary use of force was displayed.”

"It seemed that they had done their best to contain the situation,” said Councilwoman Laurie Cumbo, who represents the area where the stabbing took place.

With reporting by Rachel Holliday Smith, Sybile Penhirin and Ben Fractenberg