One day before a scheduled hearing that could have revoked its license to operate in New York, Standard Chartered Bank reached an agreement with a New York state regulator that accused it of willfully bypassing sanctions against the Iranian Government.

On Tuesday, the bank agreed to a settlement with the New York's Department of Financial Services (DFS) and will pay a $340 million civil penalty. The bank also agreed to install a monitor, chosen by DFS, to evaluate money-laundering risk controls for a period of at least two years. DFS examiners will also be placed on site at the New York unit of the international bank, which is headquartered in the U.K. Standard Chartered also agreed to permanently install its own personnel to oversee and audit offshore money-laundering due diligence and monitoring.

The willingness of the bank to negotiate with DFS is an abrupt about-face from the stance it took just last week.

On Aug. 8, using both its Twitter feed and a more formal statement, Standard Chartered said it “rejected” the charges leveled against it two days earlier. While DFS claimed that the bank conspired to conceal at least $250 billion in transactions with the Iranian government that were moved through its U.S. subsidiary, the bank countered that an internal investigation found “mistakes” that totaled a mere $14 million.

Ultimately, however, Standard Chartered “agreed that the conduct at issue involved transactions of at least $250 billion,” according to a DFS statement.

As part of the settlement, an August 15 hearing with the state regulator has been cancelled. The agreement does not preclude any forthcoming enforcement or settlements that may arise from ongoing investigations by other regulators, among them the U.S. Treasury Department, the Federal Reserve, the U.S. Department of Justice, and the Manhattan District Attorney's office.