Selena Gomez's intruder pled no contest to felony stalking on Friday (20.06.14).
Che Cruz - who was arrested twice in one week for trespassing at the 21-year-old singer's $3 million mansion in Calabasas, California earlier this year - was ordered to seek treatment in a mental health facility.
The 20 year old must undergo a total of 180 days of treatment, but he is not required to stay at the facility after 30 days, according to gossip website TMZ.com.
The judge also issued a 10-year restraining order, requiring Cruz to stay at least 200 yards away from the 'Come & Get It' hitmaker at all times.
The stalker was first arrested on March 30 for trespassing and was initially charged with a misdemeanour and slapped with an emergency protection order.
But just hours after being released from police custody on April 4, he returned to her home again and attempted to jump the fence into her yard. He was then charged with felony stalking and violating the original restraining order.
Meanwhile, new pictures have emerged of Selena, who sought treatment in rehab in January, resting her head on her on-again, off-again boyfriend Justin Bieber's shoulder during a break at a recording studio this week.
A source said that the 'Spring Breakers' star's family are "worried about her reconciliation" with the 20-year-old Canadian singer, whom she first began dating in 2010, because they think he is a bad influence.