TMZ/Getty
Exclusive

'Jackass' Director Claims Bam Sent Him Death Threats ... Restraining Order Granted

Bam Margera's been sending increasingly disturbing messages to 'Jackass' director Jeff Tremaine, including threatening his safety and that of his children ... according to new legal docs.

The court has granted Tremaine's request for a temporary restraining order against Bam, requiring him to stay at least 100 yards away from Jeff, his wife and kids ... and to stop contacting him.

Tremaine claims he's been getting harassed by Bam since February, after Jeff says Bam no-showed for a virtual meeting to discuss how he could help Margera with his mental health and sobriety struggles.

Since then, according to the docs, Bam's been on the warpath on social media. Tremaine claims Margera's publicly attacked him, threatened violence, compared him to Harvey Weinstein, posted obscene drawings and made a comment that he and Johnny Knoxville can "pencil in there [sic] death certificate."

On top of that, Tremaine claims Bam's sent him several direct threats against his kids, including one that read ... "Look at your children and grab your pocket book and write a check, if you are greedy, and cheap, look at your children again. If you don‘t sign the paper, look at you children. Sign your stupid f***ing contract before your (sic) not safe anywhere."

According to Jeff, the contract Bam is referring to seems to be one Margera wrote up himself. Tremaine says he's in great fear for his family's and his personal safety.

@bam__margera / Instagram

As we reported ... Bam recently went on a fuming rant against Tremaine and Knoxville, claiming they strung him along to be part of "Jackass 4" only to cut him loose over what he calls unreasonable demands.

Click here for info about our online advertising practices.