Around 40 percent of UBS shareholders rapped the Swiss bank for awarding hefty pay checks despite big losses, a warning to Chief Executive Oswald Gruebel not to follow market excesses.

Taking into account investors who abstained, only a narrow majority of 55 percent of shareholders present at a packed annual meeting in Basel backed the bank's 2009 compensation plan, allowing nonetheless the non-binding motion to go through.

The large share of votes against will keep Gruebel under pressure at a time when the bank needs to attract top staff, including financial advisors needed to stop client withdrawals.

It's a clear signal from investors and I think... it will have to be taken into consideration by management. Beat Amstutz, spokesman for large asset manager Swisscanto, which voted against the bonus package, said.

Gruebel said the bank expected client withdrawals to continue despite a slowdown in the first quarter.

More than $50 billion of writedowns on credit losses drove UBS to its biggest annual loss in 2008 and threatened its survival, prompting state intervention. The bank has also been the target of a high-profile U.S. tax fraud investigation.

UBS paid 3 billion Swiss francs in cash bonuses in 2009 despite annual net losses of 2.7 billion francs ($2.6 billion), Gruebel did not take a bonus.

Money is not the only value, said disgruntled UBS investor Christine Renaudin. Let's make the new UBS a bank that will make sustainable profit without being a slave to money.

Around 60 small shareholders lined up to speak at the AGM, with many expressing anger at their personal losses and at bonuses that could exceed 100 times an average person's salary.

Chairman Kaspar Villiger, a former Swiss finance minister who joined the bank in March, said curbing variable pay would take away the banks' chances of recovery and survival.

Gruebel, hired just over a year ago to turn around UBS, said earlier in the day the bank had not yet succeeded in restoring trust, especially in Switzerland.

MANAGEMENT EXONERATION IN QUESTION

While most investors turned a blind eye on the bonus issue in the light of progress made, a vote on discharging management responsibilities for 2007, the year of risky bets on subprime products, looks tight.

A rejection could theoretically pave the way for legal action against then chairman Marcel Ospel, now a hate-figure for the Swiss public, and CEO at the time, Peter Wuffli.

Primitive societies would sacrifice their elite to appease the gods, and that's what some Swiss would like to do to Ospel and company today, said Peter Thorne, an analyst with Helvea. It's a human instinct but let's hope we're beyond that now.

The importance of such an historic rejection would be largely symbolic, as UBS won't seek compensation from former executives, and individual shareholder action is costly.

Shares in UBS traded 2.3 percent higher at 1452 GMT. Credit Suisse stock was up 2.1 percent and the STOXX 600 European banks index was 1.2 percent higher.

Top bankers have said Gruebel needs a few months of calm and an end to negative headlines to restore client trust in UBS.

LAWMAKERS SEEN APPROVING UBS DEAL

That will depend on the fate of a deal struck with the United States last year to end a bitter tax investigation that has shaken customers' trust and dealt a blow to Switzerland's traditional bank secrecy. Parliamentary approval is needed.

Chairman Kaspar Villiger said he was very concerned about the future of the U.S. tax deal.

The Swiss government tried to put pressure on parliament by saying on Wednesday it saw no alternative to the deal, which contains a clause that would allow the U.S. to restart legal proceedings to force the handing over of 4,450 UBS client names, if Switzerland fails to deliver them on time, U.S. legal sources have said.

The right-wing SVP, Switzerland's biggest party, has said it will vote against the deal. But Swiss No. 2, the Social Democratic party, whose vote could make or break the deal, crucially signaled on Tuesday they would back it if the government introduced tax curbs on bonuses.

If the Social Democrats vote in favor, the deal will go through, but they are attaching some conditions to their vote, said the Christian Democrats spokeswoman Marianne Binder, adding her party was leaning toward approving the UBS deal.

The Liberals, the party of Finance Minister Hans-Rudolf Merz, are expected to support the UBS deal in parliament but they and the Christian Democrats alone do not have a majority.

We will know if the numbers are sufficient in a few weeks' time, Fabio Abate, a liberal who heads a key parliamentary financial committee assessing the deal, told Reuters.

($1=1.051 Swiss Franc)

(Additional reporting by Jason Rhodes, Katie Reid and Martin de Sa'Pinto; editing by Erica Billingham and Simon Jessop)