Los Angeles district attorney's spokesman Ricardo Santiago says Che Cruz admitted trespassing at an initial court appearance Wednesday and was immediately sentenced.
Cruz was arrested Sunday in Gomez's guesthouse and was charged Wednesday with one count of misdemeanor trespassing.
Santiago says Cruz was sentenced to three years of probation and ordered to stay away from Gomez and her home in Calabasas (cal-uh-BASS'-us), Calif.
Authorities say Gomez arrived home Sunday night and called security after hearing noises on the property.
Gomez rose to fame as the star of the TV series "Wizards of Waverly Place."