Illinois made a mistake, a $168 million one, and it wants the money back.

The department of revenue discovered that since 2014 it has doled out more than it should have to 6,500 local governments, thanks to an error in how it calculated the disbursements they receive each year to make up for their lack of power to tax businesses.

For most, the windfall was paltry, less than $10,000. But for 10 districts, it was $1 million or more. Illinois gave Chicago $19.4 million more than it should have, and the Chicago Board of Education, which is fighting to stave off insolvency, was overpaid by $23.5 million.

“We will work with the taxing districts in the future here to lay out a plan to recollect the money over a long-term period,” Terry Horstman, a spokesman for the department, said in a telephone interview on Wednesday. “It’ll be spread out over a long duration to minimize the fiscal impact as much as possible.”

The patience will be welcomed by Chicago’s school district, which is already asking the state for more money -- not less -- to deal with its $1 billion deficit and mounting retirement bills, while the city is grappling with its own pension funding crisis.

For Illinois, the discovered error will make a small dent in its own fiscal strains, which have left Republican Governor Bruce Rauner and the Democrat-led legislature mired in a record-long budget impasse. This week, the state comptroller said she will delay elected officials’ paychecks as part of an effort to conserve cash and compel them to act.

Rather than demand the money back, Illinois’s department of revenue will reduce what’s given out in the future to recoup the overpayment, Horstman said. The mistake was discovered as part of a tax-system modernization effort during the implementation of a new bookkeeping system.