Swiss bank UBS AG will pay $780 million and hand over the names of some U.S. customers in an agreement to resolve criminal charges that it defrauded U.S. tax authorities.

The Justice Department said on Wednesday that Switzerland's largest bank has entered into what is known as a deferred prosecution agreement on charges of conspiring to defraud the United States by impeding the Internal Revenue Service.

In an unprecedented move, UBS, based on an order by the Swiss Financial Markets Supervisory Authority (FINMA), agreed to immediately provide the U.S. government with the identities of, and account information for, certain United States customers, the department said.

UBS has also agreed to expeditiously exit the business of providing banking services to United States clients with undeclared accounts, it said.

UBS agreed to pay a total of $780 million in fines, penalties, interest and restitution, the department said. The agreement was accepted by a federal judge in Ft. Lauderdale, Florida.

John A. DiCicco, acting assistant attorney general of the Justice Department's Tax Division, said in a statement, The veil of secrecy has been pulled aside and we will continue to aggressively pursue those who shirk their federal tax obligations or assist others in doing so.

(Reporting by James Vicini; Editing by Bernard Orr)