LOS ANGELES — A man clutching a love letter when he was arrested in Sandra Bullock's home as the actress cowered in a closet and called police for help was ordered Thursday to stand trial on stalking and weapons charges.

Evidence showed that Joshua James Corbett stalked the Oscar-winning actress, broke into her home and had an arsenal of illegal assault weapons, Los Angeles Superior Court Judge Terry A. Bork ruled.

Bork said a 911 call in which a panicked Bullock described seeing a man in her home showed that Corbett was a danger.

"I'm in my closet. I have a safe door," Bullock, 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,' " Los Angeles police Officer Jose Bermudez testified.

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

"The love letter that Mr. Corbett carried with him professed nothing but love and admiration," attorney 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 had 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," Segall 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," Bork said.

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

Bullock did not testify during Corbett's preliminary hearing. Bork heard from several police officers who testified about responding to Bullock's home, as well as a Los Angeles police weapons expert who testified about the assault weapons and machine guns found at Corbett's home

Corbett, 39, who is being held on more than $2 million bail, has pleaded not guilty to all charges. He was scheduled to be arraigned again April 23 on all 26 felony counts.

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

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