Jennifer Lopez isn't messing around when it comes to her privacy.

The upcoming World of Dance and former American Idol judge has been granted a temporary restraining order against an alleged stalker whom Lopez claims has a history of violence, Us Weekly reported.

The 47-year-old singer's lawyers filed restraining order-documents in the Los Angeles Superior Court on Tuesday against Timothy McLanahan.

McLanahan attempted to meet Lopez multiple times and was once arrested when he crossed the line.

"Suspect has driven his vehicle onto victim's property and wants to see her and was arrested, follows victim by his own admission, suspect has history of violence and suspect continues to send mail and flowers to victim," the court's director of public information, Mary Hern, told Us on Wednesday of Lopez's claims.

Lopez's bodyguard also insisted in the court documents that McLanahan is a transient and has previously been arrested for threats and firearms violations, TMZ reported.

McLanahan has reportedly been ordered to stay at least 100 yards away from Lopez as well as her workplace and vehicle, her eight-year-old twins Max and Emme, their home, and the kids' school.

A court hearing on the ruling is scheduled for January 24.

Lopez had another run-in with a stalker in 2013 when John M. Dubis -- whom the reality TV star had a restraining order against at the time -- was reportedly taken into custody after breaking into her Hamptons mansion and living in her pool house undetected for six days when Lopez was not staying there.

Lopez, who is currently dating rapper Drake, signed on to judge and produce NBC's new reality dancing competition World of Dance. A premiere date has yet to be set.

Lopez previously served as a judge on American Idol for five seasons beginning with Season 10. She took Season 12 off and the show wrapped after 15 seasons.