Sandra Bullock's stalker has been sentenced to five years probation.

The 'Blind Side' actress locked herself in her bedroom cupboard after discovering Joshua Corbett in her house in the early hours of one morning in June 2014, and the man has now been ordered to stay away from the 52-year-old star for the next 10 years, and continue with his in-patient treatment at a mental health facility, TMZ reports.

Although Joshua won't be going to jail for getting into Sandra's house, the actress - who was already in possession of a restraining order against him - is likely to be comforted by the fact he's been put on probation, as it means he will be monitored regularly by someone who will ensure he is taking his required medication.

In early hearings in the case, the panicked call the emergency services which the actress - who has adopted children Louis, seven, and Laila, five - placed after discovering an intruder in her home was played in court.

Breathing heavily, Sandra told the dispatcher: ''I'm in my closet. I have a safe door. I'm locked in the closet right now.''

The 'Gravity' actress went on to give a description of the man and explained she had got out of bed after hearing a noise.

She added: ''I thought it was a wind blowing. Then I saw the person.''

Sandra tried to navigate police through security but was unable to open a gate at her driveway with her cellphone.

She worriedly said: ''Now my phone is not working so maybe they know how to override my system.''

When officers got in to the property, the 'Speed' star was heard tearfully thanking the dispatcher.

Other evidence submitted included testimony from Los Angeles Police Officer Jose Bermudez, who described how Corbett was clutching a notebook containing a two-page letter to the actress and magazine photos of her when he was arrested.

He added: ''I'm sorry. I love you Sandy.''

Security footage showed Joshua outside the actress' gate on each of the three days before his arrest, while entries read from his notebook begged the star - who he described as his wife and said he wanted to have sex with her - to open the ''two large impervious gates'' at the front of her property for him.