Ashley Benson
The actress fears her stalker will try and come to her home.Reuters

Ashely Benson, star of American teen drama Pretty Little Liars, has been granted a restraining order against a former security guard who claimed that "God" told him to pursue her romantically.

James Gorton Jr., who was recently fired from his job as a guard on the Warner Bros. lot where the show is filmed, has been ordered to stay at least 100 yards away from her.

According to court documents obtained by TMZ, Gorton told people he was in a relationship with Benson - despite being a married man.

He claimed that their romance started after she happened to glance at him one day. From then, his attraction toward her increased, especially after she started silently communicating messages to him.

The 49-year-old also insisted that their relationship was approved by a higher power, which encouraged him to pursue her romantically.

A judge granted Lathan the protection order after she revealed she feared he would turn up at her home.

It has been a stressful week for Benson, who plays Hanna Marin in the ABC teen drama, after she was once again snubbed at the Teen Choice Awards.

"Every year... Same thing," she tweeted after failing to win a gong among the individual nominations.

Benson's brush with a stalker comes just days after Hollywood actress Sanaa Lathan took legal action against an obsessed fan.

Shawn Caples, 28, who was discovered in the Love and Basketball star's laundry room by contractors earlier this month, has been ordered to stay at least 100 yards away from her.