Cops say the man never entered Rihanna's home ... but, in fact, entered the home next door believing it was Rihanna's home.
He was arrested outside of that property ... not Rihanna's home.
A man was arrested outside of Rihanna's Southern California home in the Pacific Palisades ... after neighbors saw the guy snooping around and apprehended him Thursday night ... TMZ has learned.
Law enforcement sources tell us ... the suspect has told police someone emailed him instructions on how to get into the home ... so he rolled over to the property and followed the directions.
We're told the instructions worked ... because the man was able to get inside the home ... where he allegedly snooped around for a while before neighbors noticed something was up.
Our sources tell us ... neighbors went over to the home and confronted the man -- and eventually detained him when they realized he didn't belong there. Police were called to the scene and took the man into custody.
The man is currently being investigated for burglary.