UBS said it remained cautious about its prospects after client withdrawals spurred by protracted U.S. tax litigation dragged the Swiss bank into another big quarterly loss on Tuesday.

Overall, our outlook remain cautious, consistent with our view that economic recovery will be constrained by low credit creation and the structural weakness in consumers' and governments' balance sheet, Chief Executive Oswald Gruebel and Chairman Kaspar Villiger said in a letter to shareholders.

The bank posted a net loss of 1.4 billion Swiss francs ($1.31 billion), and suffered 39.4 billion francs of outflows at its wealth and asset management divisions.

The bottom line was affected by one-off charges.

The loss came in contrast with forecast-beating results at Swiss rival Credit Suisse and U.S. bank Goldman Sachs , which took advantage of a market rebound while UBS was busy cutting costs and fighting damaging U.S. tax litigation.

The U.S. government and UBS struck a deal on Friday to settle the tax dispute by the end of this week.

UBS is not expected to pay a fine as part of the tax deal and could hand over to Washington 5,000 names of U.S. clients holding secret Swiss accounts, or 10 percent of the names Washington was after.

This is a positive development in a matter that has adversely affected our efforts to regain the trust of our clients and to restore momentum to our business, Gruebel and Villiger said of the prospective deal.

Analysts polled by Reuters had expected the Swiss bank to nearly treble its net loss in the second quarter to an average forecast 1.1 billion Swiss francs ($1 billion).

UBS had already warned it would post a loss in a June profit warning and said it saw outflows in all its wealth management and asset management divisions.

The Swiss bank giant had to accept a 6-billion-Swiss franc state cash injection last year after making $54 billion writedowns on toxic assets. When the bank raised $3.5 billion of new capital last month, the government said it had agreed not to sell its stake before August 4 as part of the deal.

Shares in UBS have missed out on much of the recent rally in the financial sector, but rose in the wake of the U.S. tax deal to gain 8 percent in the year to date against a 42 percent rise for the DJ Stoxx European banking sector <.SX7P>.

(Writing by Lisa Jucca)