Updated

SAN FRANCISCO (Reuters) - A U.S. appeals court agreed on Friday to throw out key government evidence prosecutors say linked baseball home-run king Barry Bonds to steroid use, dealing a setback to a long-simmering case.

The ruling opened the way to a trial over whether Bonds lied about using steroids, but the government now must decide whether to continue with the proceeding, which stopped in February 2009 on the eve of picking a jury.

A three-judge panel of the Ninth Circuit Court of Appeals ruled two-to-one to affirm U.S. District Court Judge Susan Illston's evidentiary rulings.

Illston described calendars and coded drug test results as hearsay. She ruled they were inadmissible without testimony from an important witness, Bonds's former trainer Greg Anderson, who refused to testify.

Prosecutors said the logs linked Bonds to steroids.

Bonds, who says he is innocent, passed Hank Aaron to become Major League Baseball's career home run leader in 2007.

Other baseball stars such as Mark McGwire and Alex Rodriguez have admitted to using the performance-enhancing chemicals, tarnishing the reputation of what has long been known as America's quintessential sport.

Bonds aimed to cleanse his own name at the trial, where he is facing 11 felony counts of lying to a grand jury about drug use. He faces up to a decade or more in prison if convicted.

A spokesman for prosecutors declined to comment and Bonds' lawyer was not immediately available for comment.

(Reporting by Peter Henderson, editing by Philip Barbara)