Shawn Johnson

Shawn Johnson has obtained a three-year restraining order against the Florida man who was accused of attempting to break into the Dancing with the Stars studio to meet her.

A Los Angeles court commissioner ruled that Robert O'Ryan, 34, cannot contact the Olympic gymnast or her family, the Associated Press reports. Johnson was granted a temporary restraining order last month against O'Ryan, who declared he would be with the 17-year-old "no matter what," according to the family's petition.

O'Ryan has pleaded not guilty to felony stalking and two misdemeanor counts of carrying a loaded firearm in a vehicle. He remains on $220,000 bail and was not represented at Tuesday's hearing. Johnson's parents attended the hearing, but were not required to testify.

O'Ryan jumped a fence at the Dancing lot before being detained by security, police said. Court papers show police later found two loaded guns, duct tape, love letters and a map in O'Ryan's car.