Exclusive

The son of ex-"Real Housewives of Orange County" star Lauri Peterson says he was almost killed in jail ... and now he's suing.

Josh Waring just filed a lawsuit Monday against Orange County and two OC Sheriff's deputies assigned to the Orange County men's central jail ... Josh claims the sheriff's deputies tried to have him killed out of retaliation.

According to new legal docs, obtained by TMZ, Josh claims guards inside the jail told him a razor blade attack against him was retaliation for prior complaints Josh made about sheriff's deputies.

Play video content TMZ.com

As we first reported ... Josh was ambushed back in October 2019 at the Orange County jail in Santa Ana and brutally assaulted by another inmate wielding razor blades wrapped in towels. The attack was caught on camera, and Josh claims guards let it happen because he complained about his case.

Remember ... Josh was locked up for nearly 4 years while waiting for his trial following a July 2016 arrest when he was accused of shooting a man outside a sober living home. Waring initially pled not guilty.

In the suit, Josh details his harrowing time behind bars ... claiming one of the sheriff's deputies, Ever Zelaya, threatened to choke him out and warned him to watch out. He says Zelaya told him "You better watch the f*** out, I just killed the last guy who pissed me off and I got a paid vacation."

According to the docs, Josh claims Zelaya and another sheriff's deputy, Ryan Hansen, also tried to kill him when they entered his cell and unleashed several rounds of pepper spray balls.