Former Rep. Aaron Schock of Illinois has agreed to repay tens of thousands of dollars in taxes and to campaign committees in exchange for prosecutors dismissing his felony corruption case.

Schock appeared Wednesday morning in Chicago federal court where he agreed to repay his three campaign committees nearly $68,000. He must work with the Internal Revenue Service to determine how much he owes in taxes. If he holds up his part of the deal, prosecutors will drop the original felony counts that were filed against him within six months.

Schock resigned from Congress in 2015 amid scrutiny of his spending. He was indicted in 2016 on 22 counts, including wire fraud and falsification of election commission filings.

Schock told reporters after Wednesday's court hearing that "there was never an attempt by me or my staff to commit crimes."