Barclays will pay $1.25 billion to resolve allegations that it engaged in fraudulent accounting and failed to monitor its traders as it pushed a deal to buy UBS AG for $1 billion.

The settlement, announced Friday, will allow Barclays to avoid criminal charges, but the company will be forced to admit to a “significant amount” of fraud, including the loss of $1,099 million, the U.K.-based bank said.

The bank, which is based in London, said it would pay $3.9 billion to avoid a criminal conviction in the case and settle claims that the bank’s trading methods were deceptive and that it failed to adequately supervise traders and manage its risk.

The deal resolves accusations that Barclays had engaged in deceptive accounting and lost $1 million to fraudulent transactions as it moved toward the deal.

The U.S. Securities and Exchange Commission had filed criminal charges against Barclays in April 2015, alleging it misled investors and employees about the risk of a global financial crisis.

The SEC said Barclays “was in the market for a buyer at the time of the transaction” and that the transaction was a result of a deal involving a UBS deal.

UBS has denied any wrongdoing and said the bank is “very pleased” to resolve the matter.