A man arrested in Sandra Bullock's home clutching a love letter as the actress cowered in a cupboard will stand trial on stalking and weapons charges.

Evidence showed Joshua Corbett, 39, stalked the Oscar-winner, broke into her home and had an arsenal of illegal assault weapons, Los Angeles Superior Court judge Terry Bork ruled.

Judge Bork said an emergency call in which a panicked Bullock described seeing a man in her home showed Corbett was a danger.

"I'm in my closet. I have a safe door," Gravity star Bullock, 50, breathing heavily, is heard telling the dispatcher in the recording played in court. "I'm locked in the closet right now."

Corbett was clutching a black notebook with a two-page letter to Bullock and magazine photos of the actress when he was arrested.

"He said, 'I'm sorry. I love you Sandy', " Officer Jose Bermudez of Los Angeles police told the court.

A defence lawyer argued unsuccessfully to have stalking and burglary charges thrown out because Corbett was suffering from a delusion that he was married to Bullock and was only trying to deliver a love letter.

"The love letter that Mr Corbett carried with him professed nothing but love and admiration," Paul Takakjian said. "There is nothing in there about harming her. The people are trying to make more of the case than there is."

Deputy district attorney Wendy Segall said Corbett appeared at Bullock's house three nights in a row and had broken into the home in the middle of the night.

"It's clear that he was stalking her repeatedly and maliciously," she said. "There is not a more clear-cut case of stalking than this one."

The judge said graphic entries in the notebook, combined with photos of the actress wearing sheer clothing with a low neckline supported an inference that there was a sexual motivation.

"You are so hot and intelligent and lithesome and taut," the judge read from the notebook, followed by an entry with sexual expletives.

"One sees there is more than merely a desire for connubial bliss, however misplaced," Judge Bork said.

Corbett also is charged with having assault weapons, tracer ammunition and machine guns that were found when authorities searched his home. He was not armed when he was arrested at Bullock's home, police have said.

Bullock did not give evidence during Corbett's preliminary hearing but Judge Bork heard from several police officers who went to her home, as well as a police weapons expert who gave evidence about the assault weapons and machine guns found at Corbett's home.

Corbett, who is being held on more than two million dollars' bail (£1.3m), has pleaded not guilty to all charges. He will appear in court again on April 23 on all 26 felony counts.

Bullock told police during the police call that she was not armed and her son was not home at the time.

During her call to police she gave officers instructions on how to find her bedroom. When they got there, Bullock, who sounded like she was in tears, thanked the dispatcher.