Federal prosecutors in Illinois have agreed to drop charges against former Rep. Aaron Schock in exchange for paying back tens of thousands of dollars to the IRS and his own campaign.

The surprise deal came during a status hearing for the former Republican lawmaker. Under the new agreement, the 37-year-old Schock will have to pay $42,000 to the IRS and $68,000 to his campaign fund in return for having felony charges dropped.

Insetad of a felony charge, Schock's campaign pleaded guilty to a misdemeanor count of failing to report expenses properly.

SCHOCK, FORMER RISING GOP STAR, CALLS CORRUPTION TRIAL AGAINST HIM A 'FISHING EXPEDITION'

"I am very pleased this case is concluding," Schock said in a statement. "This case has dragged on for more than four years and I am ready to put this behind me and move forward."

He added: "I will be following very closely the terms of the agreement reached in court today, including financial restitution, and I am ready to move forward with my professional and personal life."

U.S. District Judge Matthew Kennelly approved the deal after prosecutors called it a “fair and just” outcome given that Schock has no previous criminal record and has left public service, the Chicago Tribune reported.

Schock was indicted in 2016 on charges of misusing funds. He resigned amid scrutiny of his spending, including to redecorate his Capitol Hill office in the style of the television show "Downton Abbey" and flying on a private plane to attend a Chicago Bears game.

Schock's downfall was as swift as his rise in Congress, having been a young, fresh face of the Republican Party and sought-after fundraiser for fellow GOP candidates. He was an active social media user who chronicled his world travels for business and pleasure.

Yet those very Instagram posts, in addition to questions over his office decor and travel expenses, led to a growing list of Schock's troubles. In 2015, The Associated Press relied on location data from his Instagram pictures when it reported he spent taxpayer and campaign funds on flights aboard private planes owned by some of his top donors.

CLICK HERE TO GET THE FOX NEWS APP

The indictment charged Schock with wire fraud, falsification of election commission filings, filing false federal income tax returns, making false statements, mail fraud and theft of government funds. It also alleged he spent $40,000 in government funds to redecorate his Washington office in the style of the television series "Downton Abbey," and had asked the House to reimburse him for nearly $30,000 worth of camera equipment.

It also accused him of running up a $140,000 mileage tab over six years, reimbursements for 150,000 more miles than his vehicles actually traveled. Schock has maintained his innocence and his attorneys have described the case as an attempt to embarrass and humiliate him. They contend many of the issues in the indictment were administrative ones that many members of Congress grapple with.

The announcement on Wednesday comes just weeks after the U.S. Supreme Court declined to take up his appeal.

Fox News' Matt Finn and The Associated Press contributed to this report.