John Mayer was granted a temporary restraining order against a fan who allegedly stalked and threatened him, and made reference to killers Ted Bundy and Mark David Chapman, according to court papers obtained by DailyMail.com.

The 41-year-old filed papers last Tuesday in Los Angeles seeking a restraining order against Ryan Jeremy Knight, 39, from Charlotte, North Carolina.

Mayer claims Knight began harassing and stalking him in March, became more aggressive in April and has continued to make disturbing social media threats to Mayer and members of his team.

Knight allegedly told Mayer to watch his back, threatened to kill him, taunted her 'put many a Jew in the hospital' and tried to turn up to an event where Mayer was at in June, according to court documents.

Mayer said the messages left him in fear of his life and caused him substantial emotional distress, leading a judge to grant his request and ordered Knight to stay 100 feet away from Mayer and his home.

John Mayer was granted a temporary restraining order against a fan who allegedly stalked and threatened him and made reference to infamous killers Ted Bundy and Mark David Chapman, according to court papers obtained by DailyMail.com

The 41-year-old filed papers last Tuesday in Los Angeles seeking a restraining order against Ryan Jeremy Knight, 39, from Charlotte, North Carolina. Knight was arrested last March for felony stalking (left) and in June 2017 (right) for misdemeanor stalking according to records by the Mecklenburg County Sheriff.

Knight allegedly told Mayer to watch his back, threatened to kill him, tried to turn up to an event where Mayer was at in June, and taunted 'I've put many a jew in the hospital', according to court documents

Knight was arrested last March for felony stalking and in June 2017 for misdemeanor stalking, according to records by the Mecklenburg County Sheriff.

Among the messages Knight allegedly sent to Mayer include: 'You step from me again and I will kill you,' 'All ya had to do was be my pal', 'I'm everywhere like god,' and 'PS watch your back.'

Mayer writes that Knight has an 'apparent obsession' with him, allegedly telling Mayer 'F**k you for all that you do ya narcissist,' 'You ain't s***,' and 'I will beat you and your whole crew at the same d**n time.'

Another set of messages from court documents include: 'I'm gonna murder her JM,' 'I'm gonna be famous after all,' 'And kill her mom and her BF and BFF,' 'I try hard to be your friend,' and 'I tried too hard to be her BF.'

Another set of messages from court documents include: 'I'm gonna murder her JM,' 'I'm gonna be famous after all,' 'And kill her mom and her BF and BFF,' 'I try hard to be your friend,' and 'I tried too hard to be her BF'

They allegedly continue: 'I went to jail for five days and paid 10 grand in lawyers fees, court costs, probate costs etc,' 'My entire life savings.'

In reference to killers, Knight wrote, according to court documents: 'I'm not Bundy,' 'I'm not Mark David Chapman.'

Another set of messages include Knight's disdain for life and 'b****es. And teens. And cops. And PO's. And the law. Because the world does me wrong.'

Mayer is currently on a world tour with his next stop being in Chicago, Illinois on Wednesday night.

The Grammy-winning artist mainly resides in Los Angeles.