JPMorgan Chase has agreed to pay $1.7bn (£1bn) to victims of the Bernard Madoff fraud following a settlement with US prosecutors.

The settlement comes after Federal prosecutors accused the bank of ignoring red flags about Madoff’s crimes.

“We recognise we could have done a better job,” said JPMorgan spokesman Jennifer Zuccarelli. The bank has agreed to improve its controls.

While JPMorgan acknowledged failures in its protections against money laundering, the settlement includes a so-called deferred prosecution agreement that allows it to avoid criminal charges.

No individual executives were accused of wrongdoing. JPMorgan was Madoff’s primary bank in the later years of a fraud that lasted for decades.

The bank had a relationship with Madoff dating back to 1986, according to documents released by the US Attorney’s office.

It ended in 2008 when Madoff revealed to the FBI that his investment advisory business was a Ponzi scheme.

According to the complaint, Madoff’s account – account 703 – received deposits and transfers totalling $150bn over the period from 1986 until the fraud was discovered in 2008, almost exclusively from Madoff Securities.

JPMorgan employees began raising red flags about the account from the late 1990s up until 2008, but no action was taken to alert US regulators.

The 75-year-old Madoff pleaded guilty to the fraud and is currently serving a 150-year prison sentence in the US.

Over the past year, JPMorgan has paid close to $20bn in settlements with regulators for various violations relating to the US financial crisis, the so-called ‘London whale’ trading loss, and manipulating the London inter-bank offered rate, or Libor.

JPMorgan boss Jaime Dimon has taken a proactive stance in ridding the bank of various investigations into its practices over the past year.

In his annual letter to shareholders from April 2013, Mr Dimon wrote: “I feel terrible that we let our regulators down.”

The bank is still facing scrutiny from US regulators over its current hiring policies in China.

Shares in JPMorgan fell slightly on news of the settlement.