Under fire from Mayor Rahm Emanuel, the Chicago Park District and Supt. Mike Kelly “mutually decided” Thursday to trash a three-plus-year golden-parachute contract that Kelly was given just over two months ago.

Mayoral candidates were nearly universal in condemning Kelly’s contract as one of several given to city agency chiefs that would saddle a new mayor with Emanuel’s appointees or force beleaguered Chicago taxpayers to spend nearly $1 million to get rid of them.

Emanuel wasn’t happy, either. City Hall sources said the mayor was blindsided. His handpicked park board didn’t clear the agreement with City Hall prior to approving it in December at the final meeting headed by Jesse Ruiz, then the park board president, who since has left the board to join the administration of newly elected Gov. J.B. Pritzker.

RELATED: Rahm’s agency heads could outlast him thanks to golden parachute contracts

Making matters worse was that a state law passed in August whcih took effect Jan. 1 would have capped Kelly’s severance payout at 20 weeks — or about 4 1/2 months of salary.

Under his contract, though, Kelly would have been guaranteed nearly twice that if he were terminated without cause.

“The mayor is very proud of Mike Kelly and all that he and the board have accomplished, including winning the gold medal of excellence,” said a top mayoral aide, who spoke on the condition of not being named. “However, the contract issue was not handled well. Mike realizes that and made the right decision to walk away from it.”

Emanuel is intensely loyal and notoriously reluctant to throw his allies and appointees under the bus.

But sources said he was so angered by Kelly’s contract and how it was handled that he’s been pressuring the park district to trash the agreement ever since the Chicago Sun-Times revealed it.

On Thursday, parks spokeswoman Michelle Lemons told the Sun-Times that the board and Kelly had “mutually decided to terminate” Kelly’s contract. That means he will not receive severance if he is replaced.

Kelly could not be reached for comment.

Ruiz defended the contract Thursday as a “common practice for CEOs” and refused to comment on the termination, saying “I’m not on the board anymore.”

But he confirmed that no one in the mayor’s office was consulted before the board voted on Dec. 12, though he said he did consult with the Illinois Association of Park Districts.

RELATED: Candidates rip golden parachutes for agency heads

Asked whether the timing of the new state law had any effect on his decision, Ruiz would only say that “assuming the severance is ever going to be utilized” was a hypothetical. A new mayor or the holdover board members she inherits — who are very pleased with Kelly’s work — may decide to retain him, Ruiz said.

One of that law’s co-sponsors, State Sen. Bill Cunningham (D-Chicago) said “that obviously is not in keeping with the spirit of the law if (parks officials) did it specifically to get it done before the law went into effect.”

The Sun-Times reported last week that Emanuel had tied the new mayor’s hands with contracts for the heads of the parks, City Colleges, Chicago Public Schools and the Chicago Housing Authority that — if all four are let go early — would cost about $820,000 plus benefits to undo. Taxpayers would pay more for their replacements’ salaries.

The most egregious example was Kelly.

Unlike the others who signed contracts when they took over their agencies, he’s been serving as superintendent without one since 2011.

If at least four board members voted to get rid of Kelly — as was required if he did nothing meriting termination — taxpayers would have owed Kelly eight months of his salary, plus health insurance for his family.

The contract locked in Kelly’s pay at $222,000 for this year, increasing it to $230,000 in 2020, through Dec. 31, 2022.

What’s more, Kelly would have automatically been entitled to an additional year if the board failed to give four months’ notice that it wouldn’t renew his contract.

Ruiz said then he offered Kelly a written deal like other agency heads to make sure Kelly wasn’t replaced “cavalierly” by a mere “political supporter” of the new mayor.

The move was an apparent attempt to make certain that the $500 million Obama Presidential Center and a companion plan to merge the Jackson Park and South Shore golf courses goes smoothly long after Emanuel, the project’s No. 1 cheerleader, leaves office. The merger gained momentum when Obama chose Jackson Park for his presidential center, but the $30 million plan hit a fundraising snag, derailing Kelly’s plan to quickly begin construction.

In a letter released by newly-elected Park Board President Avis LaVelle, the board defended Kelly’s contract and characterized the “golden parachute” label as a “gross distortion.”

The contract was offered to Kelly to “provide continuity and stability to the Park District on a number of important endeavors,” including pension reform, moving Park District headquarters to Brighton Park and more than $200 million in ongoing and imminent capital projects, it states.

The letter praises Kelly for his “thoughtful, tangible approach to programming” at parks across the city, saying, “he has done so with no assurances or guarantees when it is customary for park agency executives across Illinois to operate with employment contracts.”