Barry Bonds arrives at the federal courthouse in San Francisco, Tuesday, March 22, 2011. The Bonds perjury gets under way with opening arguments, more than three years after baseball's all-time home run king was charged with lying to a federal grand jury when he denied knowingly taking performance-enhancing drugs.

Photo: Lance Iversen, The Chronicle

Barry Bonds arrives at the federal courthouse in San Francisco,...

Image 2 of 11

Greg Anderson, the former trainer for Barry Bonds, arrives at the Phillip Burton Federal Building and United States Court House with attorney Paula Canny on March 22, 2011 in San Francisco, Calif. Photograph by David Paul Morris/Special to the Chronicle

Photo: David Paul Morris, Special To The Chronicle

Greg Anderson, the former trainer for Barry Bonds, arrives at the...

Image 3 of 11

Greg Anderson, former trainer of baseball player Barry Bonds, left, walks through the lobby of the federal court in San Francisco, with his attorney Mark Geragos right for the second day of Bond's perjury trial Tuesday, March 22, 2011.

Photo: Lance Iversen, The Chronicle

Greg Anderson, former trainer of baseball player Barry Bonds, left,...

Image 4 of 11

FILE - This Feb. 13, 2008, file photo shows federal agent Jeff Novitzky on Capitol Hill in Washington. For someone who does his best work behind the scenes, Novitzky is hardly a stranger to the spotlight. And depending on the results of an ongoing investigation into the sometimes-shadowy world of pro cycling, he could soon become better-known still.

Photo: Susan Walsh, Associated Press 2008

FILE - This Feb. 13, 2008, file photo shows federal agent Jeff...

Image 5 of 11

Barry Bonds arrives at the federal courthouse in San Francisco, Tuesday, March 22, 2011. The Bonds perjury gets under way with opening arguments, more than three years after baseball's all-time home run king was charged with lying to a federal grand jury when he denied knowingly taking performance-enhancing drugs.

Photo: Lance Iversen, The Chronicle

Barry Bonds arrives at the federal courthouse in San Francisco,...

Image 6 of 11

Barry Bonds arrives at the federal courthouse in San Francisco, Tuesday, March 22, 2011. The Bonds perjury gets under way with opening arguments, more than three years after baseball's all-time home run king was charged with lying to a federal grand jury when he denied knowingly taking performance-enhancing drugs.

Photo: Lance Iversen, The Chronicle

Barry Bonds arrives at the federal courthouse in San Francisco,...

Image 7 of 11

Robert Powell and Julie (no last name given) both from Daily City California are supporters of Greg Anderson, former trainer of Barry Bonds, wait outside the federal court building in San Francisco for Anderson to arrive for the second day of Bonds' perjury trial Tuesday, March 22, 2011.

Photo: Lance Iversen, The Chronicle

Robert Powell and Julie (no last name given) both from Daily City...

Image 8 of 11

Greg Anderson, former trainer of baseball player Barry Bonds, walks through the lobby of the federal court house in San Francisco, for the second day of Bond's perjury trial Tuesday, March 22, 2011.

Photo: Lance Iversen, The Chronicle

Greg Anderson, former trainer of baseball player Barry Bonds, walks...

Image 9 of 11

Greg Anderson, the former trainer for Barry Bonds, is greeted by supporters as he arrives at the Phillip Burton Federal Building and United States Court House on March 22, 2011 in San Francisco, Calif. Photograph by David Paul Morris/Special to the Chronicle

Photo: David Paul Morris, Special To The Chronicle

Greg Anderson, the former trainer for Barry Bonds, is greeted by...

Image 10 of 11

Greg Anderson, the former trainer for Barry Bonds, arrives at the Phillip Burton Federal Building and United States Court House on March 22, 2011 in San Francisco, Calif. Photograph by David Paul Morris/Special to the Chronicle

Photo: David Paul Morris, Special To The Chronicle

Greg Anderson, the former trainer for Barry Bonds, arrives at the...

Image 11 of 11

Greg Anderson, the former trainer for Barry Bonds, gets ready to go through the metal detector as he arrives at the Phillip Burton Federal Building and United States Court House on March 22, 2011 in San Francisco, Calif. Photograph by David Paul Morris/Special to the Chronicle

Photo: David Paul Morris, Special To The Chronicle

Greg Anderson, the former trainer for Barry Bonds, gets ready to go...

The federal drug agent who spearheaded the BALCO steroids case accused Barry Bonds on Tuesday of thwarting his investigation by giving grand jury testimony that was "inconsistent with the facts."

Jeff Novitzky, the government's point man in a series of high-profile probes into steroids in sports, was the leadoff prosecution witness in the former Giants outfielder's trial on charges of lying under oath to a federal grand jury.

During his 2003 testimony before the grand jury probing the steroid ring operated by the Bay Area Laboratory Co-Operative in Burlingame, Bonds said he had never knowingly used BALCO drugs.

The testimony, which came after Bonds was granted immunity from prosecution for drug crimes, "absolutely" impeded the BALCO probe, Novitzky told a jury in San Francisco federal court.

Clashing stories

Bonds' story directly contradicted the testimony of other athletes who had acknowledged to the grand jury that they had received undetectable designer steroids from BALCO and from Bonds' trainer Greg Anderson, Novitzky said. His account also conflicted with evidence seized in a federal raid on BALCO, the agent said.

"Mr. Bonds' testimony was inconsistent with the facts that had been gathered to that point," said Novitzky, a former Internal Revenue agent and now a Food and Drug Administration investigator on steroid use.

"We had to take a look at other testimony that was provided that was contrary to Mr. Bonds'," he said. "Which person is telling the truth here?"

Bonds has pleaded not guilty to five felony charges - four counts of lying under oath and one of obstruction of justice. Legal experts say that to win a conviction, the government must not only prove that Bonds lied, but that false statements were "material" - that they affected the course of the grand jury's investigation.

Tip about BALCO

Novitzky, a tall man with a shaved head, testified that he was an IRS agent in 2002 when informants told him that BALCO President Victor Conte was dealing steroids to elite athletes, sometimes with the aid of Anderson, Bonds' friend and weight trainer.

During a "covert" phase of the investigation, Novitzky said, he began making late-night "trash runs" at BALCO, picking up the company's garbage and sorting through it for evidence.

"For about a period of a year I did this every week in the middle of the night," he said.

Gradually, he said he obtained evidence that BALCO's clientele of athletes - stars of Olympic track and field, the NFL and major-league baseball - were receiving banned drugs at the lab, sometimes in exchange for money, sometimes for endorsements of a nutritional supplement the company also sold.

'Trove' of drugs

Then, in a 2003 raid on BALCO and on Anderson's nearby home, Novitzky said agents found a "trove" of banned drugs, along with documents reflecting steroid deals with the athletes.

To prove their case against Conte, Anderson and two suspected dealers, investigators decided to bring the athletes who had been BALCO customers before a grand jury, Novitzky testified.

He said the government had no interest in prosecuting Bonds or the other witnesses, who included then-New York Yankees ballplayer Jason Giambi and four former Giants.

All the athletes were told that to avoid becoming investigative targets, "the only thing you need to do is go in there and tell the truth," Novitzky said. But Bonds' testimony was at variance with the story the other athletes told, and that set investigators pursuing a series of investigative dead ends, Novitzky said.

Back to prison

Before Novitzky took the stand, U.S. District Judge Susan Illston sent Anderson, Bonds' trainer, back to prison after he once again refused to testify about Bonds and steroids. Anderson, who pleaded guilty to steroid dealing in the BALCO case, has already served more than a year in prison for refusing to cooperate with the federal probe of Bonds.

The government wants Anderson to authenticate doping calendars and private steroid tests that they say the trainer arranged to track Bonds' steroid use. Without his testimony, the evidence is inadmissible, the judge has ruled.

At a hearing outside the presence of the jury, Anderson once again refused to talk. As Bonds looked on, Anderson was taken away by federal marshals for the duration of the trial.