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

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 U.S. warned it was now setting its sights on other institutions and individuals involved in hiding assets from the taxman.

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 tax deal and 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.

The Swiss sold 332 million shares at 16.50 Swiss francs each, the source with direct knowledge of the deal said, at the top end of a 16 to 16.50 francs price range, and order books for the sale were three to five times oversubscribed.

That means the government would take in 5.5 billion Swiss francs, plus 1.8 billion francs to compensate for lost interest on the mandatory convertible notes, making a profit on the 6 billion francs it paid for them in October as part of a set of emergency measures taken at the height of the credit crisis.

Bankers were now allotting the shares, market sources said, and final results were expected at 1200 GMT (8:00 a.m. EDT). A spokesman for the Swiss Finance Ministry said details would be announced later on Thursday.

The sale is being 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.9 percent at 17.53 francs at 1215 GMT, having closed at 16.74 francs on Wednesday, while the DJ Stoxx bank sector index was up 1.8 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.

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 reported.

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.

For a column on the share sale click

(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)

($1=1.076 Swiss Franc)