Alan Hevesi, a Queens Democrat, who served in the state Assembly and as New York state comptroller before resigning because of scandal has died at the age of 83 after a “prolonged illness.”

Hevesi had a long career in politics starting out as a state assemblymember and served for two decades before being elected as New York City comptroller. After two terms in city government, Hevesi was elected as the 53rd comptroller of New York state in 2002.

In the Assembly, Hevesi wrote legislation that made it a crime for hospitals to turn away emergency patients and helped reform the state’s nursing home industry.

As city comptroller, he clashed with the city’s Republican mayor, Rudy Giuliani, on issues like the proposed sale of the city’s water system.

In his final public role as state comptroller, he started the first investigations unit in the state comptroller’s office.

His political career ended with his resignation from the state comptroller’s office in 2006 as part of a plea agreement due to his role in using state employees to care for his ailing wife. Hevesi later served 20 months in prison after pleading guilty for a “pay-to-play scheme” involving the New York State Pension Fund.

In a statement, Hevesi’s successor as Comptroller, Tom DiNapoli, said Hevesi “cared deeply about Queens, fiercely debated issues he cared about and fought hard for school fiscal accountability.”

Hevesi and his wife, Carol, had three children, including former New York state Sen. Daniel Hevesi and current Assemblymember Andrew Hevesi.