Rihanna has been granted a temporary restraining order against a trespasser who broke into her home.

The 'Diamonds' singer petitioned the court to ban Jonathan Whooper from getting near her after police officers determined he has trespassed on her Pacific Palisades property in Los Angeles several times.

The man was arrested after being caught at Rihanna's mansion on October 4, and he has also been identified as the same person who broke into the home a week earlier on September 29 and threw a chair through a glass door.

According to court documents obtained by TMZ, during his last visit Whooper claimed to be an acquaintance of the 'Stay' singer and declared he was her ''future husband'' when confronted by security guards.

In the petition, Rihanna said she has suffered ''substantial emotional distress and concern for her personal safety'' due to the break-ins and a judge agreed that her safety had been compromised.

Whooper has been ordered to stay at least 100 yards away from the singer per a temporary restraining order. The case will go back to court later this month and Rihanna, 25, is expected to ask for a permanent restraining order against the trespasser.

The 'Pour It Up' singer wasn't able to testify in the case as she is currently in Australia for the latest leg of her 'Diamonds' world tour.