Receive the latest television updates in your inbox

"The X Factor" judge was home when he heard a loud bang and discovered Leanne Zaloumis inside a wardrobe with a brick.

A judge on Friday banned a 30-year-old woman from going near Simon Cowell after she admitted smashing a window of the entertainment mogul's house with a brick.

Leanne Zaloumis was arrested March 24 at Cowell's west London mansion.

Prosecutors say Cowell was watching TV in his bedroom when he heard a loud bang coming from his bathroom and discovered Zaloumis inside a wardrobe with a brick.

At a court hearing Friday, Zaloumis admitted possessing a brick with intent to damage or destroy property, but denied burglary and affray.

Prosecutors accepted her plea, meaning she will not face trial.

Judge John Denniss said the 102 days Zaloumis has spent in jail were sufficient punishment, but warned she would go to prison if she breached her bail conditions, which forbid her from contacting Cowell or going within 300 yards (meters) of his home.

She also has to wear an electronic tag and observe an overnight curfew.

Cowell, 52, has gained fame in both Britain and North America as producer and an acerbic judge on TV talent shows including "The X Factor" and "America's Got Talent."

His spokesman, Max Clifford, said Cowell was "glad that the judge was understanding and sympathetic, and hopes that she (Zaloumis) gets some help and support."