SAN JOSE, Calif. (KRON) — Former UFC heavyweight champion Cain Velasquez hugged his defense attorneys and his wife cried tears of relief when a judge granted bail for the fighter on Tuesday afternoon.

Santa Clara County Superior Court Judge Arthur Bocanegra set bail at $1 million, which Velasquez is expected to post later today. The judge also ordered home detention, GPS monitoring, outpatient treatment for impulse control, and a stay-away order from the case’s alleged victims.

Velasquez’s eight-month incarceration without bail inspired a #FreeCain movement with MMA fighters and community members rallying to support him.

Velasquez is charged with attempting to murder a suspected child molester, Harry Goularte, on February 28 during a wild high-speed chase and shooting in Morgan Hill.

Cain Velasquez, left, and Brock Lesnar during a UFC mixed martial arts match in Anaheim, Calif., Saturday, Oct. 23, 2010. Velasquez won by TKO in the first round. (AP Photo/Jae C. Hong)

A different judge, Judge Shelyna Brown, had previously denied bail for the MMA star three times. But on Tuesday, Judge Bocanegra told Velasquez, “I have to believe that you will not jeopardize anything that would take you away from your son and daughter. Don’t prove me wrong.”

Bocanegra said he based his ruling on several factors. He noted that the court had received numerous letters written by Velasquez’s supporters that describe him as a devoted father and husband.

Bocanegra said, “Mr. Velasquez is 40 years old, married, with two children. He has no criminal history. The incident was extremely serious and appears to be an isolated incident directly connected to the sexual assault of his 4-year-old (family member). There is a heat of passion defense. Mr. Velasquez has enormous support from the community. Mr. Velasquez is not a flight risk.”

The judge’s decision was made at the conclusion of a preliminary hearing in which Bocanegra ruled that the case will move forward to a trial.

Prosecutor Aaron French strongly objected to granting bail. “The defense is trying to play into the court’s emotions by saying it’s unfair that Mr. Velasquez is in custody and Harry Goularte is out of custody.”

French said “you’d have to be crazy” to think that the MMA fighter is not a danger to the public. “He was a danger to everyone that was on the roads that day. He riddled the car with bullets.” San Jose police said Velasquez chased Goularte’s pickup truck for 10 miles, at times leaning out the window to fire off shots. The chase ended after Goularte’s stepfather was shot in the arm and Velasquez surrendered to police.

The scene inside the courtroom for this week’s preliminary hearing was anything but ordinary. Professional MMA fighters sat in the courtroom gallery. The defendant was twice as large as the sheriff’s deputy guarding him. And one of the fighter’s fans shouted, “Cain we love you! I hate child molesters! Free Cain!” before escorting himself out of the courtroom.

The alleged victim, Goularte, refused to testify by invoking his Fifth Amendment rights, which protect him against self-incrimination. Goularte is charged in a separate case with sexually molesting a 4-year-old boy at a San Martin daycare owned by Goularte’s mother. Goularte lived in a house where his mother, Patricia Goularte, operated Patty’s Daycare.

Velasquez’s celebrity defense attorney, Mark Geragos, referred to Harry Goularte as a “sexual predator” and “pedophile” several times during the hearing. Geragos said it took the boy a lot of courage to tell his family about being abused at the daycare.

Defense attorney Mark Geragos speaks to reporters outside the courthouse on March 7, 2022. (Bay Area News Group / Pool photo)

Geragos successfully convinced the judge to grant his client bail and characterized the Santa Clara County District Attorney’s Office as “schizophrenic” for how it handles Harry Goularte.

“This DA’s office has a schizophrenia problem. In one courtroom, they are saying he’s a child predator. And in another courtroom, they’re saying he’s the victim,” Geragos told the judge.

Harry Goularte remains out of custody on $0 bail. A preliminary hearing for his child molestation case is scheduled for begin on November 14.

This breaking news story will be updated.