CHICAGO (Reuters) -- Former U.S. House Speaker Dennis Hastert pleaded guilty on Wednesday to federal charges of evading bank rules about large cash transactions after reaching a deal with prosecutors in a hush-money case stemming from allegations of sexual misconduct.
Federal prosecutors recommended a sentence of zero to six months in prison for Hastert, but the judge said he could potentially sentence him to up to five years and a fine of up to $250,000 when he is sentenced in February.
See photos of Dennis Hastert throughout the trial:
Dennis Hastert former house speaker
Former House Speaker Hastert pleads guilty in hush-money case
Former U.S. House Speaker Dennis Hastert leaves after a guilty plea at Dirksen U.S. Courthouse on Wednesday, Oct. 28, 2015 in Chicago. (Zbigniew Bzdak/Chicago Tribune/TNS via Getty Images)
Former House Speaker Dennis Hastert arrives at the federal courthouse, Tuesday, June 9, 2015, in Chicago for his arraignment on federal charges that he broke federal banking laws and lied about the money when questioned by the FBI. The indictment two weeks ago alleged Hastert agreed to pay $3.5 million to someone from his days as a high school teacher not to reveal a secret about past misconduct. (AP Photo/Paul Beaty)
Former House Speaker Dennis Hastert arrives at the federal courthouse Tuesday, June 9, 2015, in Chicago for his arraignment on federal charges that he broke federal banking laws and lied about the money when questioned by the FBI. The indictment two weeks ago alleged Hastert agreed to pay $3.5 million to someone from his days as a high school teacher not to reveal a secret about past misconduct. (AP Photo/Charles Rex Arbogast)
Former U.S. House Speaker Dennis Hastert, right, addresses the Illinois House, where he began his political career, while Illinois Speaker of the House Michael Madigan, D-Chicago, looks on during session at the Illinois State Capitol Thursday, May 2, 2013, in Springfield, Ill. The former high school wrestler coach from Yorkville was in Springfield to support a resolution calling on the International Olympic Committee to restore grappling to the Olympic Games.while on the House floor (AP Photo/Seth Perlman)
A pedestrian walks past the Dirksen Federal Courthouse, Monday, June 1, 2015, in Chicago where former U.S. House Speaker Dennis Hastert is scheduled to make his first court appearance Thursday on allegations he agreed to pay $3.5 million in hush money to someone from the Illinois town where he was once a teacher and coach. (AP Photo/Christian K. Lee)
WASHINGTON - NOVEMBER 15: Former Speaker of the House Dennis Hastert (R-IL) walks through Statuary Hall on his way to the House floor to make his farewell address to Congress November 15, 2007 in Washington, DC. He announced his resignation today and said he will leave office before the end of December. Hastert, 65, announced in August he would not seek reelection in 2008. Hastert was the longest-serving Republican speaker in U.S. history, and the first speaker since 1955 to remain in Congress after losing the speakership. (Photo by Chip Somodevilla/Getty Images)
Former U.S. House Speaker Dennis Hastert addresses the Illinois House, where he began his political career, during session at the Illinois State Capitol Thursday, May 2, 2013, in Springfield, Ill. The former high school wrestler coach from Yorkville was in Springfield to support a resolution calling on the International Olympic Committee to restore grappling to the Olympic Games while on the House floor. (AP Photo/Seth Perlman)
House Speaker John Boehner, left, and former Speaker Dennis Hastert listen as former Speaker Nancy Pelosi talks during a tribute to Henry Clay at Transylvania University in Lexington, Ky., Friday, June 24, 2011. (AP Photo/Ed Reinke)
Former House Speaker Dennis Hastert gestures as he speaks in Statuary Hall on Capitol Hill in Washington, Tuesday, July 28, 2009, following the unveiling of his portrait. Hastert was the 51st Speaker of the House of Representatives from 1999-2007. (AP Photo/Pablo Martinez Monsivais)
Former U.S. House Speaker Dennis Hastert speaks to lawmakers on the Illinois House of Representatives floor at the state Capitol in Springfield on Wednesday, March 5, 2008. Hastert was being honored by Illinois lawmakers for his many years of legislative service. On Saturday March 8, 2008, voters in 14th Congressional District will vote in a special election to fill the seat of the retiring Hastert. Running to fill the seat are businessmen Democrat Bill Foster and Republican Jim Oberweis. (AP Photo/Seth Perlman)
Rep. Dennis Hastert, R-Ill., talks to a reporter on Capitol Hill in Washington, Thursday, Nov. 15, 2007, after giving a farewell speech on the floor on the House. (AP Photo/Lauren Victoria Burke)
Dennis Hastert, former speaker of the US House of Representatives, attends the annual meeting of the Iranian resistance, presided over by the National Council of Resistance of Iran (NCRI) in Villepinte, near Paris, on June 22, 2013. Some 500 parliamentarians from the United States, Canada, Europe, the Middle East and Arab countries were expected to join the gathering on June 22, one week after Hassan Rowhani, a moderate cleric, was declared winner of Iran's presidential election, ending an eight-year conservative grip on the Islamic republic's administration under Mahmoud Ahmadinejad. Maryam Rajavi, president of the NCRI, denounced the 'sham election' in Iran and called on the West to stand firm with respect to Hassan Rohani, 'responsible for the machine or repression'. AFP PHOTO / JACQUES DEMARTHON (Photo credit should read JACQUES DEMARTHON/AFP/Getty Images)
WASHINGTON - JULY 28: Former House Speaker Dennis Hastert (C) is joined by current Speaker Nancy Pelosi (D-CA) and Minority Leader John Boehner (R-OH) during a ceremony unveiling Hastert's portrati at the U.S. Capitol July 28, 2009 in Washington, DC. Hastert is the longest serving Republican speaker to date, holding the post from 1999-2007. (Photo by Chip Somodevilla/Getty Images)
FILE - In this 1985 file photo, U.S. Rep. Dennis Hastert, R-Ill., speaks in Springfield, Ill., when he was an Illinois state Rep. from Oswego. A newly unveiled indictment against Hastert released Thursday, May 28, 2015, accuses the Republican of agreeing to pay $3.5 million in hush money to keep a person from the town where he was a longtime schoolteacher silent about "prior misconduct." (AP Photo/Seth Perlman, File)
FILE - In this July 28, 2009, file photo, former House Speaker Dennis Hastert, left, with his wife Jean, right, and grandson Jack, take part in a ceremony in Statuary Hall on Capitol Hill, where Hastert's portrait was unveiled. A newly unveiled indictment against Hastert released Thursday, May 28, 2015, accuses the Republican of agreeing to pay $3.5 million in hush money to keep a person from the town where he was a longtime schoolteacher silent about "prior misconduct." (AP Photo/Pablo Martinez Monsivais,File)
Discover More Like This
BACK TO SLIDE
The plea to one count of "structuring" - taking money out of the bank in amounts below $10,000 to evade bank reporting rules on large cash movements - marks a dramatic downfall for someone who once ranked among the country's most powerful politicians.
Hastert, 73, told District Judge Thomas Durkin that he knew that what he was doing was wrong in a hearing that lasted a little over 20 minutes.
"I didn't want them to know how I intended to spend the money," he said in a one-sentence statement.
In the plea agreement he admitted to paying $1.7 million in cash to an individual he had known for decades, in order to buy that person's silence regarding past misconduct and to compensate for the misconduct.
The indictment and the plea do not mention sexual misconduct, but unnamed law enforcement officials have told media that the past misconduct was sexual and involved someone Hastert knew when he was a teacher and coach in Yorkville, Illinois.
A separate charge of lying to the FBI was dismissed in the case.
Hastert, stooped, white-haired and wearing a gray suit, remains free on bail pending a sentencing hearing on Feb. 29.
Hastert and his lawyers declined to comment to reporters on leaving the courthouse. The former speaker has not spoken publicly since his indictment in May.