An accounting firm that gave a clean bill of health to a Bridgeport bank six months before it was shut down by federal regulators also prepared income tax returns for Ald. Patrick Daley Thompson (11th), who is charged with illegally claiming interest payments he never paid to the bank.

The managing partner of the Bansley & Kiener accounting firm, Robert Hannigan, is one of the key witnesses who federal prosecutors say will testify in their case against Thompson, a grandson and nephew of Chicago’s two longest-serving mayors, who is set to stand trial on Oct. 18.

Bansley & Kiener has decades-long ties to the Daley family, dating back to the late Mayor Richard J. Daley. The company prepared annual financial reports for Chicago’s tax increment financing districts under Mayor Richard M. Daley. The company has done accounting work for the campaign funds for the Daleys and Thompson, according to campaign finance reports he filed this summer with the Illinois State Board of Elections.

Now federal prosecutors revealed in documents filed Wednesday that the firm prepared the income tax returns Thompson and his wife, Kathleen, filed for several years, deducting about a total of $15,000 in mortgage interest they never paid on loans the alderman received from Washington Federal Bank for Savings, another client of the accounting firm.

The bank gave Thompson unsecured loans, not mortgages, so he should have never deducted the interest payments, even if he had actually paid them, prosecutors said.

The alderman’s attorneys argue the bank sent Thompson annual statements incorrectly showing he made interest payments on the loans, and that Thompson forwarded those to Bansley, which prepared his tax returns that sometimes contained more than 60 pages.

The defense attorneys also wrote in their own filing Wednesday that mistakes were made by Bansley and even by Thompson himself, writing that, “Mr. Thompson’s lack of organization and lack of attention to the details of his personal financial affairs are central to his defense.”

Hannigan hasn’t returned phone calls from the Chicago Sun-Times.

Federal regulators had discovered the massive fraud scheme in late 2017, discovering that the family-owned bank run by president John F. Gembara made numerous loans without collateral, appraisals or any expectation of repayment.

Gembara was found dead Dec. 3, 2017, inside the Park Ridge home of Marek Matczuk, a contractor who has since been charged with embezzling $6 million from the bank. Twelve days later, regulators shuttered the bank amid the massive fraud scheme that reached $90 million.

Bansley & Kiener has agreed to pay a $2.5 million settlement to the Federal Deposit Insurance Corp., the federal insurance program that had to cover most of the bank’s losses.

Federal officials subpoenaed bank records from Bansley & Kiener, but the accounting firm refused to comply until a federal judge ordered the firm to turn over the records in 2018.

At the same time the firm was fighting the subpoena, prosecutors say Hannigan and Thompson had numerous discussions on how he could amend his tax returns and repay the money he shouldn’t have deducted from his tax returns.

Thompson sent Hannigan an email on April 11, 2019, stating, “I would like to amend each year taxes that had the error with the mortgage interest for the unsecured loan from the bank” and that he would “prefer to [err on] the conservative side and pay more than under pay.”

Thompson also spent years trying to get Gembara to refinance loans from Chase through Washington Federal, prosecutors say. After Thompson obtained an unsecured $110,000 loan from Washington Federal in November 2011, Thompson wrote to Gembara 10 months later that, “I know I owe interest . . . We discussed me not paying because it was going to be wrapped in the refinance,” records show.

In another email in February 2013, Thompson wrote that he wanted to “roll” the $110,000 loan into a new loan and added, “I know we will also need to add any unpaid interest, which is approximately $4,000.”

Meanwhile, the IRS had sent a notice to Thompson and his wife in January 2013 that it was seeking $13,614. Thompson wrote to Gembara on Feb. 22, 2013, “I have a tax obligation I need to make a payment on.” Thompson wound up writing a $13,772 check to the IRS on March 20, 2013 — but it wasn’t until two days later that Washington Federal delivered Thompson a $20,000 check that gave him the money he needed to cover the payment to the IRS, prosecutors said.

In April 2013, a closing on Thompson’s refinancing through Washington Federal fell through after it was determined a lien stemming from an $88,500 North Community Bank loan to Thompson was in force. Thompson wound up asking Washington Federal to add it to his refinancing and wrote to Gembara in July 2013, “I am ready to proceed with closing. How soon will you be able to close?”

Nearly six months later, when no closing had taken place, Thompson wrote to Gembara in January 2014 complaining that North Community Bank was “pursuing legal action against me.”

“This is unconscionable!” Thompson wrote to Gembara. “I’ve asked you numerous times to reschedule the closing only to be told time and time again you would. Now I’m in a real difficult position because I’ve believed you when you said we were going to get this done.”

Thompson told Gembara to “please let me know whether you are serious in closing the loan,” and he gave Gembara more details about his dispute with North Community.