Dec. 12 (UPI) -- JPMorgan Chase might pay as much as $2 billion to the government to settle a case in the bank's alleged failure to properly warn authorities about Bernie Madoff's Ponzi scheme, the largest in history.

The JPMorgan settlement could close by the end of the year, and would include a deferred-prosecution agreement with the U.S. Department of Justice. Criminal violations would be outlined in a court filing, stopping short of indictment as long as the bank acknowledges the facts of the government's case and follows through with its settlement.

The largest U.S. bank worked with Madoff for close to 20 years, and regulators investigated why the bank hadn't informed the authorities upon suspicious activity.

While Madoff pleaded guilty in 2009, five former employees testified in a New York trial this week, including lifelong employee Frank DiPascali whose testimony was considered the most detailed picture of Madoff's fraudulent investment banking activity.