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.
A prosecutor argued Thursday that Bonds lied because he knew the truth about his steroids use would "tinge his accomplishments" and hurt his career.
"His secret was so powerful that he couldn't admit it, wouldn't admit it," Assistant U.S. Attorney Jeff Nedrow said in his closing arguments.
Bonds' defense lawyer, during his closing arguments Thursday, asked jurors to acquit him because of a technical oversight by prosecutors -- an argument the government quickly rebutted.
The judge's instructions to the jury say Bonds can found be found guilty only if his lies could have affected the grand jury's decisions and that Bonds knew it, defense lawyer Allen Ruby said.
But none of the 25 prosecution witnesses presented evidence about what decisions the grand jury made or what they might have made, Ruby said. "Who told us about the grand jury at all?"
The Internal Revenue Service agent who started the federal investigation into the distribution of performance-enhancing drugs testified that Bonds' false testimony affected his work, but Agent Jeff Novitzky was not part of the grand jury, Ruby said.
"I know that this is a little technical," Ruby said. "I don't apologize for that. Every word of the law matters."
The judge also instructed jurors to rely only what they heard from witnesses in the trial and not use their prior knowledge of the grand jury process, he said. "The government is trusting you to do what you are forbidden to do, and fill in the gaps," Ruby said.
Prosecutor Matthew Parrella, in his rebuttal, said Novitzky's investigation and the grand jury probe were "one and the same."
The jury can also read the indictments the grand jury issued in 2004 and the grand jury transcript in which "the issues are fleshed out," Parrella said.
Ruby told jurors that Bonds acknowledged to the grand jury that he used the substances known as "the clear and the cream," but at the time of his testimony, even investigators didn't know what was in them.
Bonds told the grand jury he thought Anderson was giving him flaxseed oil, Ruby said.
Nedrow, in his closing, said it was "implausible" that Bonds would take drugs "and really not know what they were."
A urine sample given by Bonds in the summer of 2003, just months before his grand jury testimony, tested positive for anabolic steroids, he said. The defense argued there was another sample taken weeks earlier that tested negative for the drugs.
Defense lawyer Cristina Arguedas, in her part of closing arguments, accused prosecutors of ignoring crimes by witnesses in exchange for their testimony against Bonds. "They will forgive it if that person will say something bad about Barry Bonds," Arguedas said.
Bonds' former girlfriend, Kimberly Bell, testified for the prosecution that she witnessed physical and emotional changes in Bonds that the government argued were indications of steroids use.
Bell testified during the trial that she had committed perjury when she told the same grand jury in 2003 that she had not noticed Bonds' shrunken testicles.
Bell also admitted she had committed mortgage fraud by lying on a home loan application, Arguedas said.
During court testimony last month, Bonds' childhood friend Steve Hoskins, who worked for a decade as his assistant, said he tried to persuade Bonds to stop using anabolic steroids in 2000 and 2003.
Bonds' defense lawyer argued that Hoskins' cooperation with the government was motivated by bitterness over Bonds firing him and by a desire for protection from prosecution for allegedly stealing money from Bonds.
Prosecutors played an audio recording that Hoskins secretly made in the San Francisco Giants locker room of a conversation with Anderson about the hazards of steroid usage.
Bonds' defense attorney suggested that Hoskins made the recording only after Bonds dismissed him in March 2003. Hoskins acknowledged that he leaked the details of the recording to investigative reporter Lance Williams, who included it in his book about the scandal, "Game of Shadows."
While he never witnessed Bonds being injected with anabolic steroids, Hoskins said he saw Bonds and Anderson emerge from a bedroom with a syringe during spring training in 2000.
Bonds complained to him that year that steroid injections "were making his butt sore," Hoskins said.
In his 21-year major league career, Bonds also set the record for most home runs in a single season in 2001, when he hit 73. He did not officially retire after he was indicted, but he never played another game.