Swiss bank Julius Baer, facing a criminal charge, has agreed to pay $547 million and cooperate for three years with American authorities to shut down accounts that enabled wealthy Americans to evade taxes, authorities announced Thursday.

Before lawyers for the bank appeared in Manhattan federal court to confirm a non-prosecution deal, two of its former bankers pleaded guilty to a conspiracy charge and agreed to cooperate. Cooperation for the bankers was expected to bring leniency at sentencing on a charge that carries a potential penalty of five years in prison.

The bank's agreement calls for it to share documents and provide witnesses at any U.S. court proceedings until February 2019. The bank will forfeit $547 million in penalties and restitution within a week and close any U.S. accounts established to evade taxes. In return, U.S. authorities will defer a conspiracy charge against the bank with the expectation that it will be dropped after three years. A bank lawyer pleaded not guilty to the charge.

"Bank Julius Baer not only turned a blind eye to tax avoiders but actually conspired with them to break the law," U.S. Attorney Preet Bharara said in a news release.

Internal Revenue Service chief Richard Weber said the court appearances send "a strong message to the international banking community as well as U.S. taxpayers who think they can outsmart the system by hiding their money in these international banks."

Prosecutors said the bank from at least the 1990s through 2009 helped many of its U.S. taxpayer clients evade taxes by filing false federal tax returns with the IRS and otherwise hide accounts at the bank from the agency.

The court appearances came more than four years after ex-bankers Daniela Casadei and Fabio Frazzetto were charged with conspiring to help American clients hide more than $600 million in offshore accounts and avoid paying taxes on the money. They had not appeared in court until Tuesday, when they entered not guilty pleas to charges.

As part of their guilty pleas Thursday, they agreed to cooperate after admitting they knew they were helping Americans evade U.S. taxes. They also said they believed their work was consistent with the bank's practices.

Prosecutors said Casadei and Frazzetto opened and managed accounts for U.S. taxpayers, sometimes linking them to fictional names, to relatives living abroad or to sham companies created to hide the true owners.

The IRS has stepped up efforts to collect taxes on Americans' income stored overseas since 2009, when Swiss banking giant UBS AG agreed to pay a $780 million fine and turn over details on thousands of accounts suspected of holding undeclared assets.

The agency has said it has collected billions of dollars in taxes as tens of thousands of Americans have come clean under programs that offered reduced penalties and no jail time to people who voluntarily disclosed assets.