"Once Upon a Time" star Lana Parrilla's summer has been far from magical ... cops say she had an unwanted visitor trespass on her palace property.
Law enforcement sources tell TMZ ... a mystery man was spotted by security in front of the home belonging to LP -- best known for playing Regina Mills/the Evil Queen on the ABC fantasy drama -- earlier in August.
We're told when security confronted the man, he took off onto the property grounds ... prompting guards to call in LAPD officers, who rushed to the Los Angeles-area home.
Cops searched the property and say the suspect -- later identified as a 40-year-old homeless man -- popped out of the house and surrendered to the officers.
We're told he was arrested for trespassing and booked into jail.
As for Lana, she luckily didn't have to experience the incident firsthand ... as cops say she was out of town when it all went down.
Cops think this was a case of a homeless person going onto someone's property, reportedly an issue in the neighborhood. However, a source familiar with the situation believes the incident is more nefarious, thinking Lana may have been specifically targeted. Again, nothing appears to have been taken.
With burglaries on the rise in Los Angeles, we're sure Lana is grateful for her security detail's swift action. In fact, she could've ended up like Goldie Hawn, Marlon Wayans, Tom Hanks, Daniela Braga, Bhad Bhabie and Farrah Aldjufrie -- all of whom have had their homes burglarized in recent months.
Not quite a fairytale ending, but better than a Grimm tale.