A judge granted Aldo Alvarez a $10,000 bond and house arrest Friday afternoon.
Alvarez is accused of attacking Palm Beach County Sheriff's Deputy Joshua McGehee outside his home in May.
According to detectives, McGehee shot Alvarez in self defense. Nine shell casings were found both inside the garage and outside the garage in the driveway and grass near McGehee's home.
Alvarez was not armed.
Alvarez's attorney Wayne Richter was pleased with the judge's decision to grant bond.
"We're just glad to have Aldo home. That is our main goal and the mission has been accomplished," Richter said.
In court, Alvarez's mother Anna Alvarez said her son is schizophrenic. She told the judge she constantly makes sure he is on his medication.
"I am very pleased and very happy. From the bottom of my heart, I want to thank everyone that has been praying for Aldo," Anna Alvarez said.
According to the judge, Aldo Alvarez must remain in his home unless going to a doctor's appointment or to see his lawyer.
He must remain away from Joshua McGehee and his family.
Also, Aldo's father Rual must take his firearm out of the home before Aldo will be released.
The prosecution asked for no bond, but said they respect the judge's decision.
"We supplied evidence we thought would prove the state's position as far as asking for no bond, but the judge believed otherwise," prosecutor Greg Kridos said.
Alvarez's attorney expects him to be back home in a matter of days.