U.S. authorities are investigating whether JPMorgan Chase tried to impede their investigation of the Bernard Madoff Ponzi scheme, CNBC has learned.

The bank is in the final stages of negotiating a $2 billion settlement involving a variety of allegations of misconduct in its role as Madoff's primary banker, according to sources. But before the settlement talks took hold in recent weeks, the bank was aggressively fighting regulators' requests for information.

That included contesting an administrative subpoena issued earlier this year by the Treasury Department Inspector General's office.

(Read more: From prison, Madoff is still trying to control the story)

"This office was looking into allegations made by JPMC's regulator, the Office of the Comptroller of the Currency (OCC) that its oversight of the bank was being impeded, specifically with respect to the bank's provision of banking services to Madoff," said Richard Delmar, counsel to Treasury Inspector General Eric Thorson, in an e-mail to CNBC.

