A Swiss-U.S. deal to end a tax dispute that nearly crippled UBS AG and undermined Swiss bank secrecy inched closer to full parliament approval as the upper house gave it its backing on Thursday.

The deal is yet to be approved by the parliament's lower house, which will vote on it next week. Yet the chances of full parliamentary backing have improved since Switzerland's main party, the right-wing SVP, lifted its objections in May.

The vote of the SVP will be key also in the lower house. But I think in the end a majority should back the UBS deal, Fabio Abate, a member of the liberal party who sits in the lower house, told Reuters.

However, a green light is not yet certain.

I think it will be slightly more difficult in the lower house, Swiss President Doris Leuthard told Swiss television SFInfo when asked about the chances of the lower house supporting the UBS deal.

The upper house also voted on Thursday against allowing a referendum on the tax deal. But the question is still open on whether the lower house would do the same, Abate said. A referendum would delay by several months the UBS agreement coming into force.

U.S. officials have said they expect the Swiss government to find a way to make the deal valid.

Bryan Skarlatos, an attorney for U.S. clients at foreign banks, said the Swiss government will do all it can to get the deal done.

The reason why Switzerland will bend over backward to do this is because UBS has a huge investment in the U.S. and they don't want to be sanctioned for failing to comply with the summons, Skarlatos said.

There is always a plan B, he said, such as creating a new treaty.

LEGAL PATCH

The United States agreed on August 19, 2009, to drop tax evasion charges against UBS after Berne promised it would disclose to U.S. tax officials bank details of 4,450 of the bank's U.S. clients in breach of Swiss bank secrecy laws.

But a Swiss court ruling in January blocked the data transfer, forcing the government to bypass the court ruling with a legal patch that requires parliamentary approval and risks delaying the sharing of bank client information beyond a deadline agreed for the end of August.

The government is convinced that this agreement is the only way to finish with the UBS case, which has kept us busy for quite some time, and to prevent a not inconsiderable harm to the Swiss economy, Justice Minister Eveline Widmer-Schlumpf told the assembly before the vote.

The United States accused UBS of helping rich Americans hide almost $20 billion of untaxed money in secret accounts. The tax probe came while the bank was already weakened by some $50 billion of writedowns on toxic assets and put its survival at risk.

The Swiss government has repeatedly said that failure to get parliamentary backing for the deal would damage UBS and possibly other Swiss banks at a time when the country is under international attack over its bank secrecy laws.

Shares in UBS, Switzerland's largest bank, closed 0.2 percent higher at 15.35 Swiss francs ($13.29) on the Swiss stock exchange on Thursday.

$1 = 1.16 Swiss francs

(Additional reporting by Kim Dixon in New York, Editing by David Holmes and Matthew Lewis)