CHICAGO -- Dennis Hastert pleaded guilty Wednesday to evading banking laws in a hush-money scheme, averting a trial by agreeing to a deal with federal prosecutors that recommends the former House speaker serve no more than six months in prison.

Before accepting the plea, the 73-year-old Republican was warned by the judge that he could go beyond the deal's recommendation and give Hastert up to five years behind bars when he is sentenced in February.

Because the plea has a sentencing range from no time to six months, Judge Thomas M. Durkin could also decide to put Hastert on probation or home confinement.

Get Breaking News Delivered to Your Inbox

The hearing revealed no new details about why Hastert agreed to pay $3.5 million to an unidentified person. The indictment says the payments were meant to conceal past misconduct by Hastert against that person but does not explain the nature of the wrongdoing.

Law enforcement sources have told CBS News that the payments were meant to hide claims of sexual misconduct from decades ago.

At the half-hour hearing in U.S. District Court in Chicago, a subdued Hastert read from a brief written statement that - like his indictment - focused narrowly on how he technically broke banking laws.

By pleading guilty, Hastert avoids a trial that could have divulged the embarrassing secrets he presumably wanted to keep under wraps by paying hush money. Judges are also generally more likely to give lighter sentences to defendants who accept responsibility for their actions and spare the government the cost of a trial.

In exchange for the plea, prosecutors were expected to drop a charge stemming from lying to the FBI.

Surrounded by U.S. marshals, former Republican Speaker of the House Dennis Hastert leaves the Dirksen Federal Courthouse Oct. 28, 2015, in Chicago. Scott Olson/Getty Images

When the judge asked Hastert to describe his wrongdoing in his own words, he read his statement, telling the court that he had been withdrawing cash $50,000 at a time. After banking officials questioned him, he said, he began taking out less than $10,000 to avoid reporting requirements.

Speaking in a halting voice and losing his place in the text at one point, he described why he lied to officials: "I didn't want them to know how I intended to spend the money."

Hastert did not say why he required so much cash or why he sought to skirt reporting requirements. As Hastert finished, the judge immediately asked: "Did you know that what you were doing was wrong?"

He responded, "Yes, sir."

Since the plea deal offers a wide punishment range, February's sentencing hearing could feature arguments from prosecutors on why Hastert should spend some time behind bars and from the defense about why he should be spared prison.

Asked by the judge if the government would call any witnesses at the sentencing, lead prosecutor Steven Block left open that possibility, saying, "We don't know if we will be calling witnesses. We will decide that at a later date."

Prosecutors could theoretically call the unnamed person Hastert was allegedly paying, a prospect that could make public the conduct Hastert sought to conceal.

The sentencing range is below what many legal experts thought Hastert could get. Many thought prosecutors would press for six months to two years in prison.

The change-of-plea hearing was the longtime GOP leader's first court appearance since his arraignment in June, when he pleaded not guilty in the same courtroom in Chicago.

A May 28 indictment accused Hastert of handing as much as $100,000 in cash at a time to someone referred to only as "Individual A" to ensure past misconduct by Hastert against the person never became public.

The plea helped seal the downfall of a man who rose from obscurity in rural Illinois to the nation's third-highest political office.

Hastert was speaker for eight years - longer than any other Republican. He also parlayed his connections into a lucrative lobbying career after leaving Congress in 2007. That career is almost certainly over.

As a convicted felon, "no congressman will want to meet with him about anything. His influence and power will be gone," said Dick Simpson, a co-author of "Corrupt Illinois: Patronage, Cronyism, and Criminality."

Known as a savvy deal maker in Congress, Hastert and his attorneys negotiated the plea deal in recent weeks, avoiding a trial that could have divulged embarrassing secrets dating back to his days as a high-school wrestling coach.

Hastert allegedly made 15 withdrawals of $50,000 from 2010 to 2012. It's what he allegedly did later in 2012 that would make his actions criminal. After learning withdrawals over $10,000 are flagged, he supposedly began taking out smaller increments, eventually withdrawing $952,000 from 2012 to 2014.

The withdrawals stopped after FBI agents questioned Hastert on Dec. 8, 2014, according to the indictment.