TMZ has learned ... Jennifer Aniston just got a restraining order against a man who was arrested after prowling around a place she frequents -- and the man had a sharp object, duct tape and is considered violent.
According to the docs, Jason Peyton was found on July 15, "laying-in-wait in a location he believes she frequents with a 'sharp object, a bag, a roll of duct tape and written messages about [Aniston]."
Aniston's lawyer says in the docs ... Peyton spent 8 days trying to find her and when he was taken into custody cops found carved messages in the paint of his car saying, "I LOVE YOU JENNIFER ANISTON."
According to the documents, obtained by TMZ, "Peyton is an obsessed, mentally ill and delusional stalker -- with a history of violence and criminal stalking -- who drove cross-country in his delusional 'mission' to locate and marry [Aniston], with whom he believes he is in a relationship."
After being arrested, the 24-year-old Peyton was placed on a 5150 psychiatric hold. He is still being held.
According to the restraining order, Peyton must stay 100 yards away from her home, places of work and vehicles. Peyton must also stay clear of her employees, agents, managers and other reps.
The way cops found out Peyton was in L.A. looking for Aniston ... he left a note for his dad on June 25 in Pennsylvania, stating he was going to California which his dad knew meant he was looking for Aniston. We're told ... ultimately, it was the mother who gave cops a heads up.
As for Peyton's violent past -- it includes stabbing himself and hitting his mother with a golf club.
Peyton, who has been institutionalized before, was ordered to take antipsychotic drugs but authorities say he stopped taking them in March.
Peyton believes he's related to Oprah, Nelson Mandela, Jay-Z, Jennifer Lopez, Courteney Cox, Bill and Melinda Gates, President George Bush (both of them) and Donald Trump.
LAPD's Threat Management Unit is involved in the case -- translation, it's serious.