Sandra Bullock Stalking Suspect Kept Diary and Machine Gun

John Shearer / AP

Breaking News Emails

Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Prosecutors charged a Los Angeles County man with multiple felony counts including stalking and possession of a machine gun in connection with Sunday's early morning break-in at the home of actress Sandra Bullock.

Joshua James Corbett, 39, was charged with felony first-degree residential burglary. He pleaded not guilty to the charges. His bail was set at $185,000.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings.

The weapon was recovered during a search at his property — he was not armed at the time of his arrest, authorities said.

Sign up for breaking news alerts from NBC News

If convicted on all counts, Corbett faces a maximum state prison term of more than seven years.

Authorities allege that Corbett scaled a fence to gain entry to Bullock's Westside property. Bullock and her child were inside the home at the time but were unhurt, according to authorities.

Police responded in about four minutes, and Corbett was arrested at the scene. Sources familiar with the investigation said Corbett had personal items belonging to Bullock at the time of the arrest. They said he also kept a detailed diary about Bullock.

On Tuesday, the judge granted a protective order that prevents Corbett from being within 200 yards of the actress.

—Andrew Blankstein