The billionaire creator of Beanie Babies was sentenced to two years of probation, but no prison time, on Tuesday for tax evasion on $25m in income he had stashed away in Swiss bank accounts.

H Ty Warner, 69, appeared somber but composed as he made a brief statement before receiving his sentence in a Chicago federal courtroom, apologizing and saying he felt "shame and embarrassment" for what he had done.

He could have been sentenced to up to five years in prison, and prosecutors were seeking prison time for Warner, who pleaded guilty last year to a single tax evasion count.

US district judge Charles Kocoras, however, sentenced Warner to probation and 500 hours of community service, praising the toy magnate for the charity work he's done.

Kocoras said his decision was difficult, but he added, "Society will be better served by allowing him to continue his good works."

The judge said Warner's "public humiliation" and "private torment" as a result of his criminal prosecution was a punishment he's already paid.

Warner was among the highest-profile prosecutions in the federal government's push to go after Americans concealing income from the IRS overseas, often in Switzerland. Prosecutors say at one point, Warner was concealing as much as $107m.

Beanie Babies first appeared in the mid-1990s, triggering a craze that generated hundreds of millions of dollars for Westmont, Ill.-based TY Inc., of which Warner is the sole owner. Forbes recently put his net worth at $2.6b.

The small, plush toys have heart-shaped name tags and are made to resemble bears and other animals. Some are designed to look like cartoon or comic book characters. As collectibles, some fetch thousands of dollars.

Warner maintained a secret offshore account starting in 1996 with the Switzerland-based financial services company UBS. He earned $3.1m in gross income in 2002 through the account, but didn't report it, prosecutors say.