A doctor who tragically lost his wife during Saturday’s synagogue attack had started CPR her, unaware that the person he was trying to save was his wife, according to a family friend.

The shooting victim Lori Gilbert-Kaye, 60, was with her husband celebrating Passover at the Chabad of Poway Synagogue near San Diego when authorities say gunman John t. Earnest, 19, invaded and opened fire with “an AR-type weapon.”

Unaware that his wife had been shot after she leaped in front of Rabbi Yisroel Goldstein, thus saving his life, the doctor raced over to help shooting victims after the bloody attack.

He started to perform emergency CPR on one woman, not realizing her identity, family friend Dr. Roneet Lev told the San Diego Union-Tribune.

Lev said, once the doctor realized that the victim was his spouse, he fainted.

According to Lev, Lori, mother of a 22-year-old daughter, had gone to the synagogue also to say Kaddish, a Jewish prayer for the dead, for her own mother who just recently passed away.

“The irony is people will be saying it for her now,” Lev, director of emergency operations at San Diego’s Scripps Mercy Hospital, told the paper.

“God picked her to die to send a message because she’s such an incredible person.

“He took her for a higher purpose to send this message to fight anti-Semitism.”

Following the shooting, which also injured three other people including an 8-year-old girl, Earnest was arrested.

An online manifesto suggests that the alleged gunman was inspired by the mass shooting at a New Zealand mosque that killed 50 Muslims on March 15.