Six months after striking a rare deal with prosecutors, former U.S. Rep. Aaron Schock on Wednesday was officially cleared of criminal charges alleging he used his campaign funds as a private piggy bank.

Completing what's known as a deferred prosecution, federal prosecutors in Chicago dropped all charges against Schock after he completed a probationary period where he stayed out of trouble and paid back $68,000 to his congressional campaign funds that he'd used for personal expenses.

Schock, of Peoria, was also required to work out a plan to pay back taxes to the IRS.

The brief hearing before U.S. District Judge Matthew Kennelly completed a stunning turn of events for Schock and cemented a deal virtually unheard of in a high-profile corruption case.

Schock, who was not required to be in court and indeed did not show, officially has a clean record, meaning he would be free to run for public office again if he chose to do so.

Neither Schock nor his attorneys could immediately be reached for comment.

Once a rising Republican political star, Schock's fall from grace began with stories of his lavish tastes, including the extravagant remodeling of his Washington office inspired by the British television series "Downton Abbey."

After he resigned in 2015 amid a federal investigation, Schock was hit with a sweeping criminal indictment in Springfield alleging he used his government and campaign funds to pay for personal luxuries, including private jets, skybox tickets at Soldier Field and paying for travel to get a haircut.

Schock denied the allegations, and his legal team accused the lead prosecutor in Springfield of pursuing the high-profile case to advance his own career.

In a stroke of luck, the case was transferred last year to Chicago because the judge overseeing the matter was accused of having improper contact with the prosecutors' office in an unrelated case.

In announcing the deferred prosecution deal in March, the U.S. attorney's office in Chicago said it had taken a fresh look at the charges and decided it would be a "fair and just" outcome, especially given that Schock has no criminal record and resigned from public office.

In his six-page agreement with prosecutors, Schock acknowledged he had a "regular practice as a public officeholder" of obtaining event tickets at face value and later selling them for a big profit.

He admitted that through this side practice, he failed to report $42,375 in income to the IRS over his six years in office. Schock also admitted overbilling the House of Representatives for mileage as he drove around his district for both official and campaign purposes.

As part of the deal, Schock's campaign committee, Schock for Congress, pleaded guilty to a misdemeanor count of failing to properly report expenses.

Schock first entered public life at 19 when he won a write-in campaign for the Peoria school board.

Elected to Congress in 2009 at age 27, he was seen as a darling of the Republican Party and had taken on crucial political fundraising roles when federal investigators began to look into his use of his campaign funds and House allowance for personal expenses.

He was charged in a 24-count indictment in November 2016 with wire fraud, mail fraud, theft of government funds, making false statements, filing false reports with federal election officials and filing false tax returns. A judge later dismissed two of those counts.