Timberlake is reported to be starring in the forthcoming Facebook film
Justin Timberlake has been granted a temporary restraining order against a woman described by his lawyer as "an obsessed, mentally unstable stalker".
Documents filed in Los Angeles Superior Court said Karen McNeil, 48, broke into the singer's Los Angeles home for the third time last week.
Ms McNeil's "motivation and obsession have become more ominous, intrusive and threatening," court papers suggest.
She has been ordered to stay at least 100 yards away from Timberlake.
Ms McNeil, who is believed to be homeless, was placed in protective psychiatric custody by police following the incident last Thursday.
The woman twice appeared at the singer's home in June, once leaving a letter characterised, in court papers, as "bizarre".
"McNeil's ever-increasing, aggressive and harassing conduct has become extremely frightening," the court order said, adding that Timberlake "fears for the personal safety of himself, his family and employees".
Los Angeles Superior Court Judge David Cunningham will consider whether to grant a three-year restraining order at a hearing in November.
The 28-year-old singer has won multiple Grammy Awards for songs such as SexyBack and Cry Me a River, and is increasingly branching into film work.