A Dallas SWAT officer and a local nurse were credited with saving a man’s life after a parishioner went into cardiac arrest during Mass on Saturday.

Senior Cpl. Darian Loera and registered nurse Magali Reynoso were at the Cathedral Guadalupe in Dallas for an awards ceremony when they suddenly had to use their emergency training.

Loera, who was there because his parents were being honored, left the church to add money to a parking meter. When he returned, a man was on the ground in cardiac arrest, Loera said.

People gathered around the man called for a doctor or nurse, so Loera identified himself as a police officer and began giving the man chest compressions, relying on his CPR training.

“I was really out of my element — that was the nerve-wracking part,” Loera said. “It's not something that I do everyday, as opposed to the SWAT police work.”

After the second set of chest compressions, the off-duty officer silently wished for a defibrillator.

“Whether it was divine intervention or miracle, Magali is holding a defibrillator as soon as I look to her,” he said.

With the help of the defibrillator, Reynoso and Loera were able to make sure the man was breathing again. Paramedics took over from there, and the man was driven away in an ambulance.

Ron Heflin, the man who had gone into cardiac arrest, recovered well; by Sunday morning, he was walking and joking again, the Texas Catholic reported. Heflin is a frequent freelance photographer for the diocesan newspaper after a long career at The Associated Press.

Bishop Edward Burns celebrated Reynoso and Loera’s lifesaving work in a tweet.

At the Bishop's Awards Mass on Sat, our colleague Ron Heflin went into cardiac arrest. RN Magali Reynoso and DPD SWAT officer Darian Loera, whose family members were honored, immediately began CPR & used AED to save his life. Thank you Darian and Magali for your heroic actions! pic.twitter.com/zKPN9DbjZY — Bishop Edward Burns (@BishopBurns) January 30, 2018

Loera is still recovering from gunshot wounds to his leg that he received while serving an arrest warrant in November — his rifle discharged by accident, and he’s undergone six surgeries since.

He said he was happy to learn that Heflin was OK before he left the reception.

“What was different about this as opposed to a lot of police work — in a lot of police work, you just go from call to call,” Loera said. “You don't ever really get to see the outcome of how it all plays out. You're so in tune with getting everything else done.”