HARTFORD, CT — The mayor of East Haven is the victim of politics or attempting to scam the system by being a double-dipper. Those were the two different stories the state Supreme Court heard Thursday.

East Haven Mayor Joseph Maturo Jr. appealed a Superior Court judge’s 2016 ruling that he could not collect retirement benefits from the town as a firefighter while serving as its top elected official at the same time.

Maturo, who watched the entire proceedings from the front row, said afterward that he felt “it went well. I hope it works out for my benefit.”

The Supreme Court heard arguments Thursday about Maturo’s appeal of Superior Court Judge Carl J. Schuman’s year-old ruling denying him the ability to collect a $43,000-a-year pension he earned during his nearly two decades serving as a firefighter for the town of East Haven before he was elected mayor. Schuman dismissed Maturo’s appeal of the Connecticut State Employee Retirement Commission’s denial of his request to collect a pension, based on past municipal service, while working full time in a new government job.

Maturo was challenging the fact that state retirement officials changed their rules in 2011 and imposed new pension restrictions after decades of permitting double-dipping — that is, collecting a municipal pension while in a new job on the payroll of a city or town.

In 2013, Gov. Dannel P. Malloy vetoed a bill that would have reinstated Maturo’s pension.

Maturo was a firefighter in East Haven for 18 years, from 1973 to 1991, retiring with a disability pension resulting from a back injury in October of 1991.

Maturo was able to collect both his pension and his $75,000 annual mayoral salary after being elected the town’s chief executive in November 1997. He continued to collect both his pension and salary for 10 years, until November 2007. That’s when he lost the mayor’s office to Democrat April Capone. He recaptured the mayoral seat in 2011 and has held the position since. He has already announced he will be running for another term later this year.

The mayor’s lawyer, Lawrence C. Sgrignari, told the Supreme Court justices that the mayor found it “particularly distressing” that he received a letter from the state informing him his pension benefits were being cut off “two days after his 2011 inauguration.”

Sgrignari told the justices the retirement rules were “changed on a whim” and that Maturo, a Republican, was picked on because he was in a high-profile position as the chief elected official of a municipality.

A lawyer for the retirement board, Michael Rose, defended the Superior Court ruling and disagreed with Sgrignari’s interpretation.

“While the initial law permitted retirees (including disabled retirees) who resumed employment with the state or municipality to continue to receive a retirement benefit if they were employed by the same department or agency, the legislature eliminated that carve-out in 1987, and prohibited a retiree (disabled or regular) from obtaining a benefit if he or she accepts employment from the same municipality or any other participating municipality,” Ross wrote in his Supreme Court brief.

“Accordingly, he may not collect a disability pension for prior service in East Haven while actively employed by the same town.”

Asked by the justices Thursday why Maturo was able to collect his pension for so long before the retirement board changed its interpretation, Rose answered: “Because we got it wrong for a number of years. It doesn’t mean we should keep getting it wrong.”

Chief Justice Chase T. Rogers asked Sgrignari why an East Haven taxpayer wouldn’t be bothered that Maturo is double-dipping.

“Why wouldn’t his pension be suspended until he is no longer working?” Chase asked Sgrignari.

Sgrignari said, first, Maturo was previously able to collect the pension until the retirement provision was changed. Secondly, he told the judge, he is not eligible to receive pension benefits in his current position as mayor of East Haven.

Sgrignari noted that state Attorney General George Jepsen has issued an opinion saying that retirement officials should return to their prior 2011 interpretation of the MERS pension law.

But Rose had a different interpretation.

“If you return to the same employer it is plain that he is an employee and you can’t get a salary at the same time you are getting a pension.”

Rose also rejected Sgrignari’s contention that Maturo was singled out.

“I see no evidence that politics played a role in this,” Rose said.