U.S. prosecutors first raised the specter of a criminal plea by Credit Suisse Group AG more than two years after starting an investigation into whether the Swiss bank had helped wealthy Americans evade taxes.

Credit Suisse on Monday became the largest bank in two decades to plead guilty to a U.S. crime and agreed to pay $2.6 billion in fines to prosecutors and regulators, a much more severe penalty than was dealt to rival UBS AG in 2009.

In a meeting with Credit Suisse’s lawyers in March 2013, U.S. Justice Department officials, frustrated by what they viewed as poor co-operation from the bank, said an indictment was possible if they did not see an improvement, according to a person briefed on the situation.

Exact details of what prosecutors were seeking could not be learned, but Credit Suisse said Swiss law prevented it from handing over names of clients to U.S. authorities, and Swiss lawmakers did not want to do anything to help the bank to do so.

By that time, Credit Suisse, officials in the United States, and the Swiss government had been negotiating for almost two and a half years with little success.

While U.S. prosecutors insisted on getting at names of alleged U.S. tax cheats, the Swiss government steadfastly maintained it would not invoke emergency law in order to allow Credit Suisse to deliver data on any of its clients.

In Switzerland, breaking banking secrecy laws can mean fines and up to three years on jail, though the Swiss government has said it will loosen those laws and adopt data sharing agreements with its neighbors if it becomes a global standard.

Swiss authorities have aggressively pursued breaches of secrecy in the past, closing off that avenue to Credit Suisse. According to several sources, the bank—much like its Zurich rival UBS—refused to entertain the idea of its management risking jail by meeting U.S. demands for client data.

UBS paid $780 million in fines and got a deferred prosecution agreement to settle similar charges, but also turned over names of 4,450 clients. That data handover was only backed by a narrow margin of Swiss lawmakers in 2010. Since then, political opposition in Switzerland against banks has hardened, with lawmakers unwilling to help Credit Suisse with a UBS-style deal.

The Swiss government had little room to maneuver either: it has been successfully challenged in court in 2010 over its emergency decision to order UBS to send data to U.S. officials. The government was later backed on appeal, but rebuked by Switzerland’s highest court over its methods in the case.

American officials grew increasingly impatient.

In October of last year, Kathryn Keneally, the head of the Justice Department’s tax division, called the bank’s lawyers and said she was prepared to recommend prosecution, the source said.

By January, prosecutors had decided they wanted to indict the bank and expected it to plead guilty, the source said.

The bank, U.S. authorities and Swiss government declined to comment beyond their public statements.

U.S. prosecutors said Credit Suisse helped clients deceive U.S. tax authorities by concealing assets in illegal, undeclared bank accounts, in a conspiracy that spanned decades, and in one case began more than a century ago.

Credit Suisse, which has a large business managing rich clients’ money, helped them withdraw funds from their undeclared accounts by either providing hand-delivered cash to the United States or using Credit Suisse’s correspondent bank accounts in the United States, the Justice Department said. Prosecutors said Credit Suisse had around 22,000 U.S. client accounts worth around $10 billion, which included both declared and undeclared accounts.

The bank was forced to plead guilty not only because of its complicity in tax evasion, but also because of its poor co-operation in the investigation, prosecutors said. It did not begin an internal probe until early 2011, and did not preserve some evidence of the wrongdoing, documents showed.

Still, the bank escaped a much worse fate. Critically, the New York state bank regulator decided not to revoke its license, sparing it from what could have been a devastating blow for a foreign bank as it could effectively have cut off its direct access to the U.S. bank market.

And top executives, including Chief Executive Brady Dougan, remained in their seats, despite suggestions by New York state regulators at one point that they resign and pressures from some critics of the bank’s leadership outside and within the bank as the probe dragged on and the costs of settling the matter kept rising.

Interviews over the past few days with sources familiar with negotiations between the bank and various U.S. authorities, including the Department of Justice prosecutors and the New York Department of Financial Services, reveal that a turning point in the long-running probe came in February this year, when U.S. senators grilled bank executives and scolded prosecutors for dragging their feet.

A report by the Senate Permanent Subcommittee on Investigations prompted New York Superintendent of Financial Services Benjamin Lawsky’s office to launch a parallel investigation into the bank’s activities, which complicated a deal in the final days of negotiations and increased the size of the penalty the bank had to pay, according to the sources.

Credit Suisse’s legal team had initially tried to keep the fine below $600 million or $800 million, but the numbers quickly outstripped that target, one of the sources said.

Credit Suisse will pay financial penalties to the Justice Department, the Internal Revenue Service, the Federal Reserve and New York’s banking regulator to settle the matter. It has already paid just under $200 million to the U.S. Securities and Exchange Commission.

The bank will take an after-tax charge of 1.6 billion Swiss francs ($1.79 billion) in the second quarter.

“We deeply regret the past misconduct that led to this settlement,” Dougan said in a statement. “We have seen no material impact on our business resulting from the heightened public attention on this issue in the past several weeks.”

Final Days

As late as this month, Credit Suisse was trying to avoid having to plead guilty, insisting that only a small division was responsible for the alleged crime and the entire bank should not have to pay for it. It wanted a deferred prosecution agreement, suggesting it would work with the Swiss government to provide the names of account holders to prosecutors, one of the sources said.

But prosecutors did not see that as a serious offer.

On Thursday last week sources familiar with the talks said the bank had reached a deal in principle with prosecutors, agreeing to a roughly $2 billion fine, including $100 million to the U.S. Federal Reserve and a $200 million credit for the SEC settlement in February over related activity.

Talks, however, hit an impasse with New York state banking regulators.

Lawsky, a former federal prosecutor who has extracted large penalties from other banks such as Standard Chartered Plc, by threatening to revoke its license to operate in New York, was looking into whether Credit Suisse had lied to New York authorities about creating tax shelters.

Sources said Lawsky’s office was playing hardball in negotiations, knowing it held the ultimate leverage—the power to pull the bank’s state license.

Lawsky’s office made an opening bid for Credit Suisse to pay $1 billion to New York regulators, one of the sources said. The office also sought reforms, including the right to appoint a monitor to watch over the bank’s activities.

Credit Suisse wanted the fine to be smaller. It also wanted the scope of the monitor to be limited and the period of appointment to be shorter, one of the sources said.

Credit Suisse and New York negotiated all weekend, one of the sources said. It was resolved late Saturday and the bank’s board approved the deal Sunday, the source said.

According to the consent order on Monday, the monitor will review and report on corporate governance and will be selected by the New York regulator. The monitor can be engaged for up to two years. It will pay a $715 million penalty as part of the agreement with Lawsky’s office.

(Additional reporting by Mark Hosenball and Douwe Miedema in Washington and Katharina Bart and Alerbt Schmieder in Zurich; Editing by Paritosh Bansal, Martin Howell and Neil Fullick)