Imprisoned O.J. SIMPSON has a secret plan to keep his Miami home, which is being sold off at a foreclosure auction.

He’s got a well-heeled buddy who’s promised to outbid all other bidders who want to live where O.J. lived – and then allow the disgraced gridiron great to live in the home.

Simpson owes more than $890,000 on the home, but sources say his businessman pal – who idolizes O.J. – is determined to make the winning bid at the Oct. 29 online auction.

“O.J. can’t believe his luck – when he heard what his pal was doing for him, he broke down in tears,” a source told The ENQUIRER.

The man owns property in Miami and often partied with Simpson be­fore he was jailed five years ago. His identity is being kept secret because he doesn’t want to generate negative publicity for his business.

“He got together with a few close O.J. pals who are prepared to put some money into the venture. But this guy is carrying the lion’s share of the investment.

“O.J. has called him from prison and told him how touched he is. His pal said that if the auction doesn’t work he will set O.J. up in an ocean­front condo he owns. O.J. was over­whelmed with emotion and, said, ‘Thanks man, I really appreciate it.’”

But the pal knows O.J. is “sick” over the prospect of losing his house.

“He’s prepared to pay whatever it takes to keep the property for O.J. and his family,” added the insider.

Simpson – now incarcerated at the Lovelock Correctional Center in Nevada for the theft of his own memorabilia during a whacky Las Vegas robbery – is awaiting a ruling on a request for a new trial.

He bought the four-bedroom, four-bath hacienda-style home, which is currently valued at $478,000, in 2000, living there with his eldest daughter Arnelle and then-girlfriend Christie Prody until December 2008. That’s when he got up to 33 years be­hind bars for the Vegas robbery.

Arnelle remained in the house, but quit making mortgage payments in March 2010. According to foreclosure documents, Simpson owes JPMorgan Chase bank $892,283.11, including principal, fees and court costs, on the property. As The ENQUIRER has re­ported, Simpson recently spiraled into a deep depression after doctors told him that due to his diabetes and high blood pressure, he could be dead in three months.

“But now that someone has shown that they care enough to think about his future, O.J. is rallying,” said the source. “He’s on a strict vegetarian diet and exercising to slim down.” If Simpson doesn’t win his freedom and passes away in prison, Arnelle plans to turn the home into a shrine to his memo­ry, said the source.

“Arnelle envisions the house as a kind of museum, like Elvis Pre­sley’s Graceland, filled with the football and acting memorabilia that O.J. still owns,” said the source.

“O.J. never wanted to lose that house, and he’s fortunate to have pals still looking out for him on the outside.”