Bam Margera's going after his old friends over his ousting from the 'Jackass' franchise he's been a part of for decades ... claiming he was forced to sign an agreement that he claims amounted to psychological torture.
According to the legal docs ... Bam's suing Johnny Knoxville, Spike Jonze, Jeffrey Tremaine along with Paramount Pictures, MTV, Dickhouse Entertainment and Gorilla Flicks for his firing.
He claims the 3 men pressured him into signing a "wellness agreement" while he was in rehab in 2019 in order to participate in the upcoming 'Jackass Forever' movie ... but Bam claims he didn't have a chance to run it by an attorney.
According to Bam ... the agreement subjected him to regular drug and alcohol tests and he was forced to take a cocktail of prescription drugs that left him depressed and drained, and restricted his ability to travel, work and live his life.
Ultimately, Bam was booted from the fourth installment of 'Jackass' for failing to abide by the conditions in the agreement, but according to the docs ... Bam got the axe for testing positive for Adderall -- something he says he's been prescribed to take for 10 years.
The lawsuit alleges Bam's treatment at the hands of Paramount and the 'Jackass' team was "inhumane" and "discriminatory." He also likens it to Britney Spears' conservatorship case.
@bam__margera / Instagram
As we've covered ... the past few months have been very rocky for Bam, as he's publicly attacked the 'Jackass' crew and had a restraining order filed against him by Tremaine.
He also previously told us he was "tortured" by his former co-stars before he was fired. Bam's suing for damages and asking for an injunction to block release of the upcoming movie.
We've reached out to Paramount ... no word back so far.