San Francisco (CNN) -- Barry Bonds' former trainer was freed Friday from the prison where he's been held since he refused to testify in the baseball legend's perjury trial two weeks ago. 

With the jury now deliberating the perjury and obstruction of justice case against Bonds, U.S. District Judge Susan Illston ordered Gary Anderson to be released. 

Illston found Anderson in contempt of court on the first day of trial testimony when his lawyer informed her that he would not take the stand to answer questions about Bonds' steroid use. 

It was the third time Anderson chose jail time over testimony. He was sent to prison for several weeks twice before when he refused to appear before a federal grand jury investigating Bonds. 

The absence of the trainer's testimony hampered the government's case against Bonds, who is charged with lying under oath when he testified about his steroids use in 2003 before the grand jury that was investigating an alleged sports doping scandal involving Anderson of the Bay Area Laboratory Co-operative. 

Bonds, 46, allegedly lied about knowingly taking performance-enhancing drugs and about being injected by anyone but his doctors. 

The jury of eight women and four men are deciding Bonds' fate in a San Francisco federal courthouse less than two miles from the ballpark where Bonds broke Hank Aaron's major league home run record in August 2007. 

The three perjury counts and one count of obstruction of justice could each carry a 10-year prison sentence upon conviction. A fourth perjury charge was dropped by prosecutors Wednesday. 
Less than 2 miles from where?
from the ballpark