Sandra Bullock came face-to-face with a crazed stalker just outside her bedroom door during a terrifying, middle-of-the-night confrontation last month, police said.

The “Miss Congeniality” actress, 49, slammed the bedroom door, locked herself inside and immediately dialed 911, begging cops to rush to her Los Angeles mansion, according to a search warrant affidavit, according to TMZ.

PHOTOS: Celebrity real estate

Bullock first heard a loud noise around 1 a.m. When she headed to her bedroom for safety, Bullock saw Joshua Corbett, who was dressed in dark colored clothing, in her hallway.

The actress alerted authorities that she showered before going to bed so the intruder may have been on the premises the entire time.

More On This...

When officers arrived, Corbett shouted, “Sandy, I’m sorry. Please don’t press charges.” He was also carrying a notebook of magazine cut-outs and handwritten notes for Bullock. “I will forever be thinking of you and Louie, my son, as you are my wife by law, the law of God and you belong to me and me to you,” read one of the notes.

Corbett was charged with residential burglary, stalking and possession of a machine gun.