Pastor then ruled that O'Ryan was legally insane at the time of his arrest last March. He will serve his sentence in a state mental hospital. He had faced up to four years in state prison and two years in county jail.
He did not react to Pastor's verdict, which came after four days of testimony and evidence. Johnson, who faced down the accused stalker in court earlier this week, was not present.
Prosecutors contended that O'Ryan harbored a dangerous obsession to meet and marry Johnson, who won an Olympic gold medal in the 2008 Beijing Olympics. He was arrested last March on a studio lot where Johnson was performing on ABC's "Dancing with the Stars," a competition she later won.
O'Ryan's attorney, Judith Greenberg, argued that O'Ryan didn't have any criminal intent and did not plan to harm Johnson.
Johnson testified on Thursday that she was scared of O'Ryan, who she had never met.
O'Ryan drove from Florida to Los Angeles in an attempt to meet Johnson.
O'Ryan had waived the right to a jury trial and pleaded not guilty by reason of insanity.
He will now undergo a mental evaluation.