Switzerland has agreed to process a request by the United States for details of 4,450 American accounts of the UBS bank to end a tax dispute between the two countries.
Under the accord, which was signed in Washington on Wednesday, UBS does not face a fine or suffer other punitive damages.
The accord is expected to ease tensions in relations between Washington and Switzerland over possible violations of the country's banking secrecy laws and prevent a clash of Swiss and US jurisdictions.
"More than two months of negotiations allowed to avoid a conflict and an infringement of Swiss sovereignty," said Justice Minister Eveline Widmer-Schlumpf at a news conference in Bern.
She hailed the accord as "a good solution", but said there was no reason to be euphoric: "There was no alternative to this solution."
The agreement lifts the threat of criminal prosecution against UBS which could have endangered the bank's existence and dealt a blow to the economy, according to Widmer-Schlumpf.
Switzerland pledged to process 500 requests for legal assistance within three months, while the remainder will have to be handled no later than 360 days after a demand has been put forward.
Initially US authorities have been seeking the confidential details of up to 52,000 clients suspected of cheating the US tax system.
The deal, which had been initialed last week, saves what had been seen as a potentially long and damaging court case with disastrous implications for UBS - Switzerland's second largest bank and the world's number two wealth manager by assets.
Foreign Minister Micheline Calmy-Rey said two months of negotiations had been arduous but excellent relations had helped to find a solution.
"Our priority was to defend our justice system, not a bank," she said.
For his part, Finance Minister Hans-Rudolf Merz stressed that the Swiss administration is facing an unprecedented number of requests for legal assistance within the next 12 months, which will cost an estimated SFr40 million ($37.2 million).
The government stressed that the accord is in line with existing law, notably a double taxation agreement, without invoking emergency law. Clients accused of fraud or severe cases of tax evasion have right to appeal with the Federal Administrative Court, according to Merz.
In February the government handed over information on 255 clients after the UBS bank admitted some of its employees had helped US citizens violate tax laws.
Merz on Wednesday urged the Swiss banking industry to avoid a repeat of the tax conflict.
"I urge the banks to respect the law. It is the least they can do," he said.
Long-sought account names
Under the terms of the accord, Switzerland has established a task force enabling the federal tax authorities to speed up the process of legal assistance.
The US Internal Revenue Service (IRS) says the deal will allow access to thousands of long-sought account names and is expected to provide even more UBS clients who voluntarily disclose their financial details to the agency.
"I believe this agreement gives us what we wanted – access to information of those UBS account holders most likely to have been involved in offshore tax evasion," IRS Commissioner Doug Shulman said in Washington.
The deal states that the civil case will be dropped if at least 10,000 UBS clients report to the IRS, including those processed by the Swiss authorities, by the end of this year.
Swiss financial centre
UBS said the agreement does not call for any payment and that the litigating parties will file a request with a court in Miami dismissing enforcement action against the bank.
"I am confident that the agreement will allow the bank to continue moving forward to rebuild its reputation through solid performance and client service," UBS chairman Kaspar Villiger said in a statement.
The Swiss Bankers Association welcomed the agreement and said the details of the out-of-court-settlement were "convincing".
"The solution found conforms entirely with prevailing Swiss law. This is of crucial importance for the Swiss financial centre because international clients rely very much on the predictability and stability of the Swiss legal system," a statement said.
The association added that UBS can now continue its consolidation process in an atmosphere free of "this legal uncertainty."
UBS posted a record loss in 2008 and benefited from a multi-billion bailout package by the Swiss government. It plans to sell its shares in the next few weeks.
Urs Geiser and Robert Brookes, swissinfo.ch
UBS is the world's number two wealth manager by managed assets and Switzerland's second largest bank.
It has a workforce of more than 76,000 worldwide, including nearly 30,000 in the US.
In February UBS paid a $780 million fine and given information on 255 clients after admitting that some of its bank employees had helped US citizens evade taxes.
UBS, which benefited from a multi-billion bailout package by the government, posted a record loss in 2008.
UBS and the US
On May 14, 2008, former UBS employee Bradley Birkenfeld and a Liechtenstein businessman were charged by the US authorities with helping an American billionaire avoid paying taxes on $200 million of assets deposited in Swiss and Liechtenstein bank accounts.
Birkenfeld turned whistleblower, giving details of UBS private banking practices to US prosecutors.
In July, a Miami court authorised the Internal Revenue Service to issue a summons on UBS demanding the release of confidential information on clients the agency suspected of tax evasion.
In the same month, UBS told a congressional hearing that it would stop offshore banking activities for US clients.
UBS agreed in February to pay $780 million and name some United States clients to resolve criminal fraud charges against it. However, this did not affect a separate demand from the IRS for the details of 52,000 UBS clients, in direct contravention of Swiss banking secrecy laws.
In compliance with the JTI standards