Debt-ridden city cuts payroll — by firing grants writer who generated millions.

Delia Kennedy says she knew her days were numbered as a grants administrator in Opa-locka.

Not because she had generated $60 million in government grants over the past four years for the financially troubled city. But, rather, because she has been helping the FBI as a witness in a long-running investigation into corruption at City Hall.

In any event, the ax fell Friday on Kennedy’s $60,000-a-year job.

“How could this have happened out of hatred and contempt because I have chosen not to participate in this crime and corruption?” Kennedy, 60, wrote in an email on Friday morning to a senior state official overseeing the city’s financial crisis.

After she was fired by City Manager Yvette Harrell, the governor’s chief inspector general, Melinda Miguel, came to Kennedy’s defense in a rebuke unseen since the governor appointed a state oversight board in June to guide Opa-locka through its difficult recovery. Her firing was the latest flashpoint in the tense relations between that board and the city’s administrators and politicians.

In an email later Friday, Miguel warned Harrell that while the governor’s office may have finally approved the city’s belated budget this week, that did not give her the leeway to do what she wants with spending and personnel.

“I need to caution you on taking any retaliatory actions against known FBI witnesses and the costs that has to your city” in potential lawsuits, Miguel wrote in an email to Harrell. “Please advise [on] the status of this employee right away.

“Approval of the budget did not in any way mean to convey that actions and spending would go without oversight,” wrote Miguel, who chairs the nine-member state oversight board in Opa-locka.

Harrell, a lawyer who has served as city manager since last May, defended her decision to fire the grants administrator along with two other employees on Friday.

She said the dismissals are part of a broader effort to cut government spending and help balance the budget halfway through the current fiscal year. (The city has an accumulated debt of at least $14 million dating back several years.)

In an email, the city manager told Miguel that Kennedy’s firing “was not in any way related to any investigations.” She pointed out there were public discussions in recent months with the oversight board about personnel cuts — including the grants administrator’s job — and no one raised concerns.

In an email, City Manager Yvette Harrell wrote that ‘none of the budgetary actions taken were at all retaliatory in nature.’

In the email, she wrote that “none of the budgetary actions taken were at all retaliatory in nature.”

Lastly, Harrell said she recognized that the state board appointed by Gov. Rick Scott “maintains oversight authority” under an emergency agreement with the city.

In an interview with the Herald, the city manager said she consulted with City Attorney Vincent Brown before Friday’s firings and he assured her that the terminations were lawful.

Harrell said she chose to eliminate the grants administrator’s job and two others in the parks and public works departments because they were redundant with other government jobs in Opa-locka.

“This is not about Ms. Kennedy,” Harrell told the Herald, noting her job would be absorbed into a grant-writing position in the police department. “I’m saddened people think this is retaliatory.”

The two others terminated on Friday were Felicia Thomas, a public works employee, and Patsy Williams, a parks and recreation employee.

The latter’s dismissal was startling because Opa-locka Mayor Myra Taylor and the other city commissioners had honored Williams last week for her 30 years of government service during Women’s History Month.

Attorney Michael Pizzi, who is representing Kennedy and Williams, said their “firings are disgraceful.”

$14 million Accumulated debt of the city of Opa-locka

In February, Pizzi filed an employment and whistle-blower complaint on behalf of Kennedy against the city manager, alleging discrimination and retaliation. Since 2013, Kennedy has generated millions in state and federal grants for a variety of Opa-locka water, sewer and building projects

Pizzi said he plans to file a separate lawsuit on behalf of Williams, 56, who made $46,000 a year and started with the city as a sanitation worker.

In a letter to the city attorney on Friday, Pizzi said that the “same city that honored her with great fanfare at the last [commission] meeting fired her and had her escorted out of the building by the police.”