Katy Perry's not taking any chances as a new mama -- she just got a restraining order against a man she claims is stalking her and is potentially dangerous.
According to new legal docs, obtained by TMZ, a 38-year-old man named William Terry has been posting lewd messages about her on social media for months -- along with threats directed at Orlando Bloom and others -- and his frightening behavior culminated with him jumping the fence last week at her Beverly Hills home.
Katy says after Terry jumped the fence on her property -- while she was home with her newborn daughter -- he refused to leave when apprehended by security ... so he was placed under citizen's arrest until the cops came and busted him for trespassing.
However, Katy says Terry's already been released and she fears he will return ... because he allegedly also tried to enter her property in early August by claiming she invited him.
In the legal docs, Katy includes multiple alarming messages posted on Terry's Twitter account dating back to December 2019. They include tweets tagged #activeshooter, comments about killing dogs and cops, threats to "snap Orlando Bloom's neck" and wishing Orlando's son and his ex, Miranda Kerr, "catch covid and die."
The tweets also include numerous graphic and sexually explicit comments about Katy.
According to the docs, Terry is believed to be homeless but attempts have been made to serve him the temporary restraining order. The judge granted it for Katy, Orlando, their newborn daughter and Orlando's son, Flynn. Terry must stay 100 yards away from all of them until a hearing next month.
As you know ... Katy just became a mother for the first time last month, as she and Orlando welcomed a baby girl, Daisy Dove Bloom.