Rebel Wilson is getting court-ordered protection from a man she claims keeps showing up at her home, imagining they have a son together and leaving gifts and letters.
Rebel's lawyer, Susan Haber, beelined it to court for a temporary restraining order ... to protect the singer from a 39-year-old man she claims has been harassing her for months.
According to new legal docs, obtained by TMZ, Rebel claims the guy somehow found her secluded Los Angeles home and dropped off a handwritten note falsely claiming they have a 20-year-old son together.
Rebel says the note described how they met at a club in 2001 and conversed, kissed and "we both know what happened thereafter" ... but Rebel says it's complete BS because she's never even met the guy.
In the docs, Rebel says the guy's also showed up at the home to leave behind handwritten notes to their fictional son ... as well as some strange gifts.
Rebel claims one of those gifts was a small, stuffed penguin with a card that says "love."
In the docs, Rebel says the man is "delusional by creating in his mind a fictitious history of a relationship he had, and wants to continue to have" with her ... and she fears for her safety, claiming he won't stop harassing her unless a court intervenes.
The judge granted Rebel's temporary restraining order ... and now the guy must stay 100 yards away from Rebel and not make any attempt to contact her.