The Swiss government said it was sure it could resolve a legal impasse threatening a deal struck by the U.S. and bank UBS to hand over data on clients the U.S. suspects of dodging taxes.

A Swiss court last week ruled in favor of a UBS client seeking to prevent her account data from being given to the U.S. tax agency, throwing doubt on Switzerland's ability to deliver details of 4,450 UBS client accounts as agreed in August.

The cabinet is convinced that it can definitively overcome the continuing legal and sovereignty conflict with the United States with all its damaging consequences for Switzerland's economy and as a financial center, the government said on Wednesday.

The Swiss government said the court ruling meant it could not cooperate in 4,200 of the 4,450 cases covered by last year's deal, running the risk the U.S. authorities could resume their civil case again against the bank.

UBS, which posts full-year results on February 9, had hoped the August deal would give it a fresh start, enabling it to rebuild its reputation and stem a torrent of client withdrawals.

I don't see this as a trigger for more net new money outflows to be more than was already expected, said Vontobel analyst Teresa Nielsen. I'm sure that the biggest issues are behind UBS now.

UBS shares, which have fallen steeply since the court ruling, made gains after the announcement before dropping back again to close down 2.4 percent, in line with a 2.4 percent weaker DJ Stoxx European banking index.

Under the agreement it appears that UBS did what it was supposed to do, and it's now an issue for the Swiss and U.S. governments to sort out, said U.S. tax lawyer Martin Press at Florida-based firm Gunster. From UBS's point of view it's a done deal.

Justice Minister Eveline Widmer-Schlumpf said the government would fulfill its commitments under the deal, which was intended to end the damaging U.S. tax case against the giant Swiss bank.

The legal conflict is between two legal systems, and this has to be solved through an agreement between the states involved, she told a news conference after a cabinet meeting.

UBS welcomed the government's decision to seek dialogue with the U.S. and said it would support the search for a solution.

As before, we will fulfill all our commitments under the agreement, UBS said in a written statement.

LEGAL RISK

If the Swiss government fails to find a solution, the Swiss court ruling could prompt U.S. officials to go back to the federal court in Miami to enforce its original summons request, a so-called John Doe summons that seeks unidentified defendants that meet certain criteria without naming them.

Swiss bank secrecy gives account holders protection against outside scrutiny. The deal struck to drop the U.S. case against UBS in exchange for revealing client names was a major departure from that tradition, which has been under global attack.

The Swiss administrative court ruled on Friday that the client's failure to file a tax form did not constitute fraud or the like, a requirement for data to be disclosed under a double taxation agreement with the United States.

The Swiss government said one possible way to resolve the problems thrown up by Friday's ruling would be to seek retroactive approval for the UBS deal from the Swiss parliament, which the court itself had indicated as a possible solution.

The United States has said it would withdraw its summons seeking client names if it got 10,000 UBS account holder names voluntarily, which could possibly make Friday's court ruling irrelevant.

Widmer-Schlumpf said the 4,450 client accounts sought by the U.S. also needed to be among the 10,000 overall disclosures. The Swiss government would press for detailed information on the amnesty program, which had been extremely successful, she added.

U.S. authorities have not revealed how many of the 14,700 names gathered in a U.S. tax amnesty program were UBS clients, increasing the pressure on the Swiss government to find a way to hand over the requested data as agreed.

(Writing by Emma Thomasson; editing by Karen Foster/Will Waterman)