U.S. District Judge Susan Illston stayed the sentence pending Bonds' appeal, which is likely to take a year or more.
Illston also fined Bonds $4,000 for his obstruction of justice conviction arising from his grand jury appearance eight years ago.
Federal officials wanted house arrest and community service, while prosecutors asked for a 15-month prison sentence. Bonds' attorneys requested probation.
The seven-time MVP was convicted after a 12-day trial in April of trying to mislead a grand jury looking into sports doping.
The Associated Press contributed to this story.