SAN FRANCISCO — Barry Bonds was convicted of obstruction of justice today but a jury failed to reach a verdict on three other counts that the home run king lied to a grand jury when he denied knowingly using steroids and human growth hormone.

The verdict, following a 12-day trial and almost four full days of deliberation, was a messy end to a case that put the slugger in the spotlight for more than three years.

Bonds sat stone-faced through the verdict, displaying no emotion. His legal team immediately asked that the guilty verdict be thrown out and U.S. District Judge Susan Illston did not rule on the request. She set May 20 for a hearing in the case.

The case also represented the culmination of the federal investigation into the Bay Area Laboratory Co-Operative steroids ring. Federal prosecutors and the Justice Department will have to decide whether to retry Bonds on the unresolved counts.