Thursday’s indictment of former House Speaker Dennis Hastert was in connection with an alleged scheme to cover up a sexual relationship that Hastert had with a male student at Yorkville High School in Illinois, according to a federal law enforcement official, NBC News reports.

The seven-page federal indictment notes in its first paragraph that Hastert was a high school teacher and coach in Yorkville from 1965 to 1981, before going on to serve as an elected official and to work as a lobbyist. All of these phases of Hastert’s career are said to be “material to this indictment,” according to the Justice Department.

Close video Pelosi on 'surprising' Hastert indictment In an interview with msnbc’s Thomas Roberts, House Democratic Leader Nancy Pelosi calls the Dennis Hastert indictment “surprising” and says it reflects “poorly” on Congress. Pelosi also talks about the 2016 elections and the recent Clinton controversies. In an interview with msnbc’s Thomas Roberts, House Democratic Leader Nancy Pelosi calls the Dennis Hastert indictment “surprising” and says it reflects “poorly” on Congress. Pelosi also talks about the 2016 elections and the recent Clinton controversies. share tweet email Embed

Hastert was allowed to remain free of his own recognizance, according to a court document Friday. His bail was set at $4,500 and no court date has been set yet.

Hastert taught government and history at Yorkville High School, and he was the school’s wrestling coach. He led the team to the state title in 1976, and later was named Illinois Coach of the Year.

As a member of the Illinois state legislature in the 1980s, Hastert spearheaded legislation on child abuse prevention, among other issues, according to several publicly available bios.

Prosecutors allege that the payments began in 2010 in increments of $50,000. But they say that, starting in 2012, Hastert deliberately structured the payments in smaller increments of $10,000 to avoid triggering bank reports to the IRS that are required for cash withdrawals over that amount. They also accuse Hastert of lying to the FBI when he told them last year that the withdrawals were for his own use, because he’d lost faith in the U.S. banking system.

RELATED: Former House Speaker Dennis Hastert indicted for cash withdrawal scheme

Since leaving Congress, Hastert has worked as a senior adviser to the Washington lobbying firm Dickstein Shapiro. He has now resigned, the firm confirmed late Thursday.

“The Denny I served with worked hard on behalf of his constituents and the country,” House Speaker John Boehner said in a written statement Friday, adding, “I’m shocked and saddened to learn of these reports.”

In an interview with Facebook, Hastert’s nephew Charles Hastert said of the allegations against his uncle, “I don’t believe it.” Speculating about the motives behind the allegations, Charles Hastert added, ”I believe it is probably a political witch hunt and party oriented.” Close video Dennis Hastert paid man to cover-up “sexual misconduct” The headline criminal case against former House Speaker Dennis Hastert. NBC’s Pete Williams reports Hastert was paying a man to conceal a sexual relationship they had when the man was a student at the high school where Hastert coached. The headline criminal case against former House Speaker Dennis Hastert. NBC’s Pete Williams reports Hastert was paying a man to conceal a sexual relationship they had when the man was a student at the high school where Hastert coached. share tweet email Embed

Hastert was asked by Politico last week about rumors that he was having trouble with the IRS. “I read what you heard, but that’s not correct,” Hastert said then. “I’m not going to talk to you.” Told by a Politico reporter in a phone interview that he was about to be indicted, Hastert said: “Well, it’s not true.”

In a brief phone interview, Phyllis Oldenburg, a well-connected Republican operative in Kendall County who played a role in launching Hastert’s political career, described herself as “shocked” and “overwhelmed” at the news of Hastert’s indictment, before quickly ending the call.

Last November, Hastert appeared on C-Span to discuss the upcoming midterm election, when a call came in from “Bruce from Illinois.”

“Hello, Denny,” the caller said. “Hey, how are you doing?” Hastert replied. “Pretty good,” the caller said. “Remember me from Yorkville?” The caller then laughed and hung up. There’s no evidence that the incident, which was unearthed Friday by The Hill newspaper, has any connection to the indictment.

Hastert served as House speaker from 1999 to 2007, the longest tenure in the post ever for a Republican. He was a loyal supporter of then-President Bush’s agenda, helping move regressive tax cuts and a Medicare prescription drug plan, among other items, through Congress.

Hastert took over as speaker just as the impeachment trial of President Bill Clinton, for allegedly lying under oath about sex with a White House intern, was set to get underway. He ascended to the post after Bob Livingston, the first choice to replace the outgoing Newt Gingrich, was forced out of the running amid allegations of several extra-marital affairs.

One low point of his tenure came shortly before the 2006 midterms, after the emergence of lewd emails sent by a member of the Republican caucus, Tom Foley, to a teenage boy. Hastert’s office was accused of knowing about the messages well before they became public. Yet Foley continued to serve as chair of a congressional caucus on missing and exploited children, right up until his eventual resignation.

Republicans lost control of Congress that fall. Hastert left Congress the following year.