BELOVED TV legend MARY TYLER MOORE has been holed up in her home after suffering two life-threatening medical crises, sources say.

Now friends fear the 76-year-old Hollywood icon is facing her final days.

“At this point, no one knows exactly what’s going on with Mary,” a close source told The ENQUIRER.

“It’s not like her to shut herself away and not speak to anyone or see friends. We’re all terribly concerned about her.”

Just months ago, Mary rushed to the side of her close friend and co-star Valerie Harper, 73, who revealed that she’d been diag­nosed with terminal brain cancer.

More recently, Mary faced her own mortality when she broke a hip and fractured a shoulder in a nasty fall at her home in Green­wich, Conn., said the source.

She was hospitalized and then developed pneumonia, which left her struggling to breathe, added the source.

The gutsy star – who’s struggled with diabetes and related health issues for more than 40 years – spent about 10 days in the hospital battling the pneumonia before demanding to be sent home. “The simple fact is that Mary hates hospitals and couldn’t wait to get out of there,” said the source.

“But since she’s gone home, Mary has refused to see friends or even speak to them. Now every­one’s afraid she’s taken a turn for the worse.”

The fall was the second in the past year for the once-perky star, who won Emmys as Laura Petrie on “The Dick Van Dyke Show” and Mary Richards on the “Mary Tyler Moore” show.

Mary crashed down four stairs at her Connecticut home last year, shattering her collarbone and several ribs.

While she eventually recov­ered, it was just another incident in a litany of health woes that have been plaguing her in recent years, including loss of vision, and heart and kidney problems, sources say.

She underwent risky surgery in to remove a benign brain tumor that had become wrapped around her optic nerve. Two days later, doctors rushed her back into surgery to control bleeding in her brain.

And in early November 2011, she was hospitalized with a grave dia­betic condition where potentially fatal acids build up in the blood and urine. She also suffers from another diabetic complication that leads to numbness and pain in the hands and feet, sources say.

Despite all her own problems, the courageous actress made time to comfort her pal Valerie, the former “Rhoda” star who made headlines when she announced her cancer di­agnosis in March.

“Mary became a daily font of strength for Val with her uplift­ing and encouraging words,” said a friend.

Another pal told The ENQUIRER: “Mary told Val that even in the darkest days you have to find the will to move on.

“Now everyone is praying she will.”