Anderson was found in contempt of court by U.S. District Judge Susan Illston at the start of the trial on March 22 and jailed for the duration of the trial after he refused to testify as a prosecution witness.
On Wednesday, after testimony in the trial was completed, Anderson’s attorney, Mark Geragos, filed a motion asking for the trainer’s release.
Prosecutors argued, however, that Anderson should be kept in jail until there was a final verdict.
But this morning Illston signed a one-page order saying, “For good cause shown, it is hereby ordered that Mr. Anderson be immediately released from confinement.”
Bonds, 46, is charged with three counts of making false statements and one count of obstructing justice in 2003 testimony before a grand jury that was investigating steroids distribution.
The former San Francisco Giants slugger is accused of lying when he told the panel he never knowingly took steroids or human growth hormone from Anderson and never received an injection from him.
Prosecutors unsuccessfully sought Anderson as a key witness to prove their claim that Bonds knowingly took the drugs.
Anderson previously spent more than a year in custody for refusing to testify before a grand jury that eventually indicted Bonds on the perjury charges in 2007.
In another development today, defense attorneys filed a motion asking Illston to give the jury a special instruction to remedy an alleged error in a prosecutor’s closing arguments on Thursday.
The motion by defense attorney Dennis Riordan alleges that Assistant U.S. Attorney Matthew Parrella “egregiously misstated the evidence” when he told jurors that Bonds understood the difference between a substance known as “the clear” and flaxseed oil.
The motion alleges that Parrella misquoted testimony by a San Francisco Giants trainer as a basis for his claim that Bonds understood that “the clear” was not flaxseed oil.
In his 2003 grand jury testimony, Bonds told the panel he had been given “the clear” by Anderson but said he thought it was flaxseed oil and not a steroid. The substance was later found to be a so-called designer steroid that was engineered to be undetectable.
Julia Cheever, Bay City News