Timberlake wrote in court filings that Karen McNeil repeatedly showed up at his house and trespassed on his property last month.
McNeil, who represented herself in the case, opposed the court order, writing in a court document that she thought she was destined to marry Timberlake and "to rule" with him.
During the hearing, Judge David S. Cunningham III ordered a five-minute recess after an outburst by McNeil when the judge issued the order.
Outside court, McNeil said, "That was all lies. I did not break into Justin's house. I was let on the property."
The 28-year-old Timberlake was filming a movie and didn't appear in court. He has won multiple Grammy Awards for songs such as "SexyBack" and "Cry Me a River."