In an instant, James Dittrich and Meredith Duffy’s new apartment in East Orange, New Jersey, went from being a safe haven to a crime scene, but first responders say Dittrich’s quick thinking and heroism helped the couple escape with their lives.

Three months after moving in to their apartment in Lenox on the Park, Dittrich was coming home late after taking their dog out for a final walk when two men followed him to his third-floor apartment.

“I heard footsteps, and they kind of bum-rushed me from behind,” he said. “And I turned around, and there was a revolver in my face.”

Dittrich said he gave the men his wallet with $25 inside, doing exactly what some self-defense experts suggest when confronted with a burglar: Give them what they want. But, Dittrich said, the men weren’t satisfied with the cash and wanted to get inside the apartment.

Dittrich made the split-second decision to let the burglars into the apartment rather than try to fight off two men, one of whom had a gun, he said. He hoped they would take some stuff and leave. As he opened the door, Dittrich said, he tried to make as much noise as possible, trying desperately to alert his fiance, Duffy, who was in the bedroom asleep.

But one of the men found Duffy and, pointing the gun at her head, sexually assaulted her, she said. Dittrich, in the other room and unaware of what happening in the bedroom, said he kept trying to make as much noise as possible in hopes of waking up his neighbors.

“I thought, 'If I make enough commotion it’s going to make him nervous, it’s going to get his attention, it might get the neighbors to call for help,'” Dittrich said.

Hearing the noise, the man with the gun pulled Duffy off the bed and dragged her back to the living room, where Dittrich and the second attacker were still arguing, according to the couple.

“He just grabbed the back of my shirt, pulled me off of the bed, put the gun back on me, said, ‘Get your purse,’” Duffy said. “Then he told me, ‘Just dump it out.’ My phone fell face down on the couch and I remember thinking, ‘There’s my phone. It’s right there.’"

In that moment, Dittrich said he was faced with a life and death decision: to take matters into his own hands and create a distraction so Duffy could get her phone and call 911.

So I reached up and I grabbed [the gun],” Dittrich said. “I couldn’t wrestle it free, but I knew, with both hands on it, I had control of it, and that was the opportunity that she needed to call. And I just, I really just hoped I could keep control of it for her to make that call.”

But when Dittrich grabbed the gun, the burglars attacked him, he said. As her fiance was beaten in front of her, Duffy was able to call for help.

“That was the absolute hardest part, was that when I dialed 911, they were just beating him so absolutely mercilessly and brutally,” she said. “And the one kept yelling, ‘Shoot him, shoot him, shoot him.’”

In the end, the attackers fled, but not before breaking Dittrich’ nose, both cheekbones, and the bones around one of his eye sockets. Both Dittrich and Duffy were rushed to the emergency room at University Hospital in Newark, where the drama of their horrific ordeal and resulting injuries happened to be captured on ABC’s medical docu-series “NY Med,” which airs Thursdays at 10 p.m. ET.