Rosie O’Donnell faced a horrifying family medical drama when her live-in love Kelli Carpenter’s stepfather had emergency surgery to clear FIVE clogged heart arteries.

The talk show host was deeply worried as Joel Safer, a 61-year-old Baton Rouge, La., dentist, was rushed into surgery to save his life.

“Joel is like a father to Rosie,” said a source. “She was panic-stricken when Kelli got the call that her stepdad was in grave danger.

“Just before Thanksgiving, Joel had a thorough medical exam that included a scan of his heart.

“His doctor told him he had five heart arteries that were clogged, and said they needed to operate immediately because Joel was in danger of having a fatal heart attack.

“Kelli was there at the hospital, along with her mother Melanie and stepsister Heidi, when Joel was whisked into surgery. Rosie flew to Baton Rouge from New York to visit Joel a few days later, after Thanksgiving.

“Joel came through the procedure with flying colors. He’s doing great and is making a quick recovery.”

Rosie is extremely close to Kelli’s family. Kelli’s sister Heidi does crafts and cooking segments on her show and is also “editor at large” for Rosie magazine.

Joel, who at one time was put off by his daughter’s sexual orientation, is now very supportive of the relationship between Kelli, 33, and 39-year-old Rosie.

“Kelli was in college at Southern Methodist University when she told Joel and Melanie she was a lesbian. They were stunned. They actually sent her to counseling in an effort to get her to go back to men,” said the source.

“But over the years they have come to accept her lifestyle. Today Joel and Melanie love Rosie like a daughter. In many ways, they are her surrogate parents.”

Rosie is estranged from her father, and her mother died of cancer when she was 10.

“Rosie is thrilled that Joel is doing so well after his heart surgery nightmare,” the source added. “But she points out that he is extremely lucky he had the checkup — otherwise he very likely would have had a massive heart attack.”