KANSAS CITY, Mo. (AP) — Jackson County will pay $5.3 million to settle a lawsuit filed by a former sheriff’s deputy who said he was fired because of his age and health conditions.

The county legislature voted Monday to pay the money to Doug Caster, who was fired in December 2015 when he was 59 years old. He said he and other senior deputies were harassed and forced out of their jobs by former Sheriff Mike Sharp and undersheriff Hugh Mills.

A jury had awarded Caster $7 million after a trial last spring. The county appealed but agreed to settle for a lesser amount before the appeal was heard, The Kansas City Star reported.

Caster, who worked in the sheriff’s office for nearly 34 years, said he also was targeted because he twice took medical leave for treatment of his diabetes.

In its response to the lawsuit, the county denied the allegations and said Caster was fired for rules violations.

Sharp resigned in April 2018 after revelations that he had an ongoing relationship with a a sheriff’s office employee while she had a pending lawsuit against Jackson County for harassment.