In a desperate bid to save his son’s life, CHARLIE SHEEN’s heartbroken father gave the out-of-control  star one final tough love warning – detox or jail.

Anguished acting legend Martin Sheen threatened to lead cops on a room-by-room drug search of the hard-partying actor’s Beverly Hills mansion unless he immediately signed himself into rehab, The ENQUIRER has learned.

The troubled sitcom star was rushed to Cedars-Sinai Medical Center in Los Angeles on Jan. 27 following a drug-and-booze binge with porno stars.

And the Apocalypse Now star was the first to visit his 45-year-old son along with Charlie’s mother, Janet Templeton.

"Martin and Janet were ready for the worst – they’d prepared themselves for Charlie’s death," an insider told The ENQUIRER.

"So when he got his son alone, Martin angrily confronted him on his drug-and-alcohol habit and dangerous lifestyle.

"Martin told him, ‘You’re killing yourself, you stupid idiot. Well, I’m not going to let it happen!’

"Martin told Charlie that unless he entered rehab immediately, he was going straight to the cops and allow them to search his son’s Beverly Hills home for drugs.

"Charlie went ballistic!

"He refused detox at the medical center – and fled after arguing with the medical staff. He opted for a rehab of his own choosing."

It was eerily similar to a situation that had taken place between father and son almost 13 years earlier.

As The ENQUIRER reported in late May 1998, Martin forced Charlie into drug rehab after the young actor had stayed up for 72 hours straight while smoking crack and partying with prostitutes.

When Charlie later bolted from Malibu’s Promises rehab facility, his distraught dad went to the district attorney’s office and begged to have him arrested.

A judge ended up ordering Charlie back to rehab.

This time Martin’s playing hardball with his philandering debauched son.

To get all the details of Martin;s toughest love scenario it’s in the new ENQUIRER