CHICAGO — A haggard Dennis Hastert appeared in court Tuesday for the first time since he was indicted, pleading not guilty to charges that he violated banking rules and lied to the FBI in a scheme to pay $3.5 million in hush money to conceal misconduct from his days as a high school teacher.

As his attorney entered the plea on his behalf, the 73-year-old former House speaker stood motionless, his hands folded and eyes downcast at the floor. When the judge asked if he understood he had to submit a DNA sample and that he could go to jail if he violated any conditions of his release, the man who was once second in the line of succession to the presidency, answered quietly, “Yes, sir.”

Hastert has not spoken publicly about the accusations that emerged two weeks ago and quickly raised questions about possible sexual abuse by the once-powerful Republican legislator from Illinois.

The politician who turned lobbyist was before Judge Thomas M. Durkin on charges that he evaded federal banking laws by withdrawing hundreds of thousands of dollars in smaller amounts and lying about the money when questioned.

At the start of Tuesday’s hearing, Hastert reached into a coat pocket and pulled out his passport, handing it to his attorney, who turned it over to a court official. Surrendering foreign travel documents is standard condition of release.

The former congressman was also ordered to have any firearms removed from his property by June 23 and was forbidden from having contact with victims or witnesses.

The judge spent most of the 20-minute hearing explaining how he believed he had no conflict of interest in the matter but then giving prosecutors and defense attorneys until Thursday to say if they want him to stay on the case.

The issue came up because he donated $500 to the “Hastert for Congress” campaign in 2002 and $1,000 in 2004. At the time Durkin was a lawyer at a Chicago law firm.

Hastert’s lead attorney, Thomas C. Green, is based in Washington and has represented clients in the Watergate, Iran-Contra and Whitewater cases.

Prosecutors did not shed any more light on the secret Hastert allegedly sought to conceal.