Cops have just detained a man at Paris Hilton's L.A. area home -- after the guy allegedly snuck past a guard gate and knocked on her front door ... TMZ has learned.
Law enforcement sources tell us private security immediately sprung into action -- and tried to apprehend the man, who was riding a bike. We're told the man tried to put up a fight, but to no avail.
The security officers were able to physically restrain the man until LAPD officers arrived on scene and took him into custody. The suspect was transported to a nearby police station for questioning.
Hilton had to deal with another scary situation at her home back in August -- when a man carrying knives allegedly tried to break into her home. Her BF pulled a gun on the suspect before anything happened.
No word if the two incidents are connected.
UPDATE: We've learned the suspect is James Rainford. He's being held on $20,000 bail. He's been booked on battery charges.