Switzerland sold its stake in UBS for 5.5 billion Swiss francs ($5.1 billion) on Thursday, making a solid profit from last year's rescue of its largest bank.

The sale of the 9 percent stake comes a day after the country agreed to reveal the names of thousands of UBS's rich American clients to Washington, settling a tax-avoidance dispute that dented its prized banking secrecy.

The United States said it now setting its sights on others helping clients hide assets from the taxman, threatening Switzerland's thriving banking sector and its status as the world's largest off-shore center.

Other Swiss banks, such as Credit Suisse , Julius Baer , Zuercher Kantonalbank (ZKB) and Union Bancaire Privee (UBP), are now fretting that the U.S. taxman's spotlight could fall on them, the Wall Street Journal has reported.

Swiss authorities said the sale showed UBS had found a solid footing again after becoming one of the biggest victims in the credit crisis, and analysts said the government exit could herald a recovery at the bank.

The U.S. deal obviously helps to rebuild UBS's reputation. With that, one of the most threatening items for UBS on the way back to profitability falls away, said Rainer Skierka, analyst at Swiss bank Sarasin.

Switzerland sold 332 million shares at 16.50 Swiss francs each -- at the top end of its price range -- for a total of 5.5 billion francs ($5.16 billion), the finance ministry said, with order books oversubscribed multiple times.

It also received 1.8 billion francs to compensate for lost interest on mandatory convertible notes, allowing it to make a 1.2 billion franc gain on its investment, a number that it said had been conservatively rounded.

Berne made a 30 percent yield on the 6 billion francs it paid for the stake in October, part of a set of emergency measures at the height of the global financial crisis, which cost UBS its spot as the world's biggest private bank.

The stake sale was run by Credit Suisse , Morgan Stanley and UBS itself, traders said.

MORE CONFIDENCE

Switzerland, like most other Western countries took over part of its banking industry after the credit crisis threatened a systemic collapse, but the sale now means it is ahead of some others in finding an exit.

The UK and the U.S. still hold big stakes in major banks, while Sweden is still the largest shareholder in Nordea after it stepped in to rescue lenders in the early 1990s.

The Swiss National Bank said the government sale indicated the market was more confident in UBS, while Switzerland's financial regulator FINMA said it supported the sale since the bank now had a stable, sound capital base.

UBS shares were up 4.6 percent at 17.50 francs at 1446 GMT (10:46 a.m. EDT), having closed at 16.74 francs on Wednesday, while the DJ Stoxx bank sector index <.SX7P> was up 1.7 percent.

In February, UBS agreed to pay $780 million and disclose about 250 client names to settle a criminal probe by U.S. authorities. One former UBS banker testified that he smuggled a client's diamonds in a tube of toothpaste.

This announcement today should send a signal, no matter what institution you're with, the IRS is willing to pursue both the institution and the individual, Internal Revenue Service Commissioner Doug Shulman said on Wednesday.

Switzerland's private banks manage around $2 trillion of foreign wealth and it is home to dozens of often secretive and privately held banks for rich clients.

(Additional reporting by Katie Reid and Rupert Pretterklieberin Zurich, Steve Slater and Daisy Ku in London and Anshuman Daga in Singapore, Editing by Will Waterman and Erica Billingham)

($1=1.065 Swiss Franc)