But past misconduct against a longtime acquaintance from the hometown where Dennis Hastert decades ago taught high school history and coached wrestling haunted the powerful Republican, the Chicago Sun-Times is reporting.

So between 2010 and 2014, Hastert allegedly withdrew $1.7 million in hush money from his bank accounts, handing it over to the acquaintance to keep quiet, according to a stunning grand jury indictment handed down Thursday. He’d agreed to ultimately pay $3.5 million, it’s alleged.

Then, when the FBI got suspicious and asked Hastert if he made withdrawals as large as $50,000 because he didn’t trust the banks, he allegedly lied, telling the feds, “Yeah . . . I kept the cash. That’s what I’m doing.”

Once second in line to the presidency, Hastert, 73, of Plano, now has an unwanted distinction: he’s believed to be the highest-ranking Illinois politician ever to be criminally charged. He faces up to 10 years in prison if convicted of structuring the alleged hush money payments to avoid detection, and of lying to the FBI.

In an ironic twist, Hastert’s ascent to become the longest-serving Republican speaker was marked by a series of scandals befalling others. He assumed the speakership when front-runner Bob Livingston bowed out over an extra-marital affair, then immediately played a leading role in the impeachment of President Bill Clinton.

His arraignment has not been scheduled, but authorities said the case has been assigned to U.S. District Judge Thomas Durkin.

Neither Hastert nor his representatives could be reached for comment Thursday, and his “past misconduct” against the unnamed acquaintance from Yorkville is not explained in the indictment. Several of Hastert’s former associates told the Chicago Sun-Times they were stunned and puzzled, though. One Hastert friend said the indictment read like Hastert was involved in a blackmail plot.

Between June 2010 and April 2012, the indictment said, Hastert made 15 withdrawals of $50,000 from his bank accounts and gave the cash to the acquaintance, named only as “Individual A,” every six weeks.

But bank employees began to question Hastert about the withdrawals in April 2012. And by federal law, those banks were required to file a currency transaction report for any transaction exceeding $10,000, according to the indictment.

So in July 2012, Hastert allegedly began withdrawing the cash in increments of less than $10,000. He still gave the cash to “Individual A” in $50,000 increments, according to the indictment.

Roughly two years later, in 2014, Hastert and Individual A allegedly changed their arrangement. Hastert began giving the acquaintance $100,000 every three months, the grand jury said, but continued to make withdrawals of less than $10,000.

In all, the feds said, he split up the withdrawal of $952,000 in cash to evade the banks’ reporting requirements.

Hastert resigned Thursday as a board member of the CME Group — the company includes the Chicago Board of Trade, the Chicago Mercantile Exchange and the New York Mercantile Exchange. His picture and biography had disappeared from the board section of the CME website. A spokesman for the CME did not return a call for comment.