“I had no contact with the governor or his office, and so we were not  I was not aware of what was happening,” Mr. Obama said. “And as I said, it’s a sad day for Illinois. Beyond that, I don’t think it’s appropriate to comment.”

Image Gov. Rod R. Blagojevich, right, returned to his home in Chicago on Tuesday afternoon after being released on a $4,500 cash bond. Credit... Carlos Javier Ortiz for The New York Times

Throughout his career, Mr. Obama has adroitly straddled the state’s bruising politics, forming alliances with some old-style politicians even as he pressed for ethics reform. But Mr. Obama had long been estranged from the governor, even though some in his political circle have had relationships with both of them, including Rahm Emanuel, his chief of staff, and Emil Jones Jr., the retiring State Senate president and a longtime mentor.

The federal accusations against Mr. Blagojevich go beyond the Senate question into what the authorities here described as a “political corruption crime spree.”

The governor is accused of racing to solicit millions of dollars in donations from people with state business before an ethics law bars such behavior in January, and threatening to rescind state money this fall from businesses, including a Chicago hospital for children, whose executives refused to give him money. He is also accused of putting pressure on The Chicago Tribune to fire members of its editorial board who had criticized him or lose the governor’s help on the possible sale of Wrigley Field, which is owned by the Tribune Company and is home to the Chicago Cubs.

Mr. Blagojevich, who looked somber during an afternoon appearance in federal court, was released from custody on a $4,500 recognizance bond after surrendering his passport. A hearing in federal court will be held in January to determine whether there is probable cause to go forward with the charges.

Sheldon Sorosky, his lawyer, later told reporters that the governor was “very surprised and certainly feels that he did not do anything wrong.”

According to the affidavit, in more than a month of recorded phone calls at his home and campaign office, Mr. Blagojevich considered numerous ways that he might personally and politically gain from the various Senate candidates, none of whom were identified by name in the court filing. One possible choice might be able to help him secure a post with the new administration as secretary of health and human services or energy; a “three way” deal involving a union and a candidate might win him a union leadership post; or perhaps, he could secure the high-paying helm of a nonprofit organization that could be created for him.