Switzerland is striving to settle a long-running tax evasion dispute between UBS and the U.S. government that challenges Swiss banking secrecy, before a key pre-trial conference on Wednesday.

The U.S. is seeking the identities of 52,000 of the Swiss bank's wealthy American clients suspected of using offshore accounts to conceal assets and evade U.S. taxes.

Miami Judge Alan Gold will ask the parties on Wednesday if they have reached a deal. If they haven't, negotiations will most likely drag on until September 21, the next available day for a trial, prolonging a legal headache for UBS that has prompted wealthy clients to withdraw their savings.

A trial against UBS, the world's number two wealth manager by managed assets, has been postponed three times.

The dispute comes as governments around the world crack down on offshore tax evasion.

Earlier on Tuesday, Liechtenstein and Britain agreed to encourage Britons with secret accounts in the Alpine principality to voluntarily disclose billions of pounds of untaxed money.

Switzerland itself is attempting to push through reforms needed to get off the Organization for Economic Cooperation and Development's grey list of tax havens, but faces the prospect of a referendum on the issue.

The Swiss and U.S. governments have already reached an agreement in principle on the major issues in the UBS case, but talks have spilled into a fifth week as the two sides have been unable to settle legal details still standing in the way of a final deal.

UBS shares, which have rallied this month in anticipation of a settlement, were down 1.4 percent at 16.07 Swiss francs at 10:09 a.m. EDT. Traders said investors were nervous on Tuesday because of uncertainty about the outcome of Wednesday's conference call between the judge and lawyers from UBS, the Swiss government and the U.S. Justice Department.

Investors expect a deal to involve the disclosure of some UBS client names and no fine for the Swiss bank giant.

Swiss diplomats have worked relentlessly to get the country's best-known bank off the hook. The SonntagsBlick newspaper said the lights in the office of Justice Minister Eveline Widmer-Schlumpf were burning until 3 a.m. last week. Berne also held an emergency cabinet meeting on Monday.

U.S. lawyers familiar with the case told Reuters earlier this week they expected a deal to finalized soon, although the details may not be immediately be made public.

All parties are attempting to structure a deal that would obviously result in UBS handing over client information on an undisclosed number of accounts tied to U.S. domiciled persons, Sarasin analyst Rainer Skierka said in a client note, adding the settlement risked further eroding Swiss bank secrecy.

The U.S. Department of Justice has declined to comment.

PROBLEMS OVER?

A settlement would provide some relief to UBS, which last year posted the biggest annual loss ever in Swiss corporate history, and allow the bank to concentrate on restructuring its business and rebuilding its weakened franchise.

A deal could also spur the Swiss government to sell its 9 percent stake in UBS, which it acquired to prop up the bank during the global financial crisis.

But it may not be the end of worries for Switzerland and bank secrecy in general. Many tax lawyers do not rule out potential further litigation or even class actions stemming from the UBS case.

Tax lawyers Asher Rubinstein and Milan Patel, who are advising UBS and other Swiss bank clients on voluntary disclosure programs, have said other Swiss banks are forcing U.S. clients with offshore accounts to disclose their holdings to the U.S. Internal Revenue Service or leave.

Furthermore, new double taxation treaties that Switzerland is pushing through to be taken off a grey list of tax havens drafted by the Organization for Economic Cooperation and Development could be rejected in a Swiss referendum.

Swiss government spokesman Andre Simonazzi said a referendum will take place and will concern the first tax treaty to be ratified, but could not give a date.

Separately, regional Swiss party Lega dei Ticinesi is collecting signatures to push through another referendum that would anchor bank secrecy to the constitution, another potential threat to Switzerland's attempt to become more transparent.

(Editing by Erica Billingham)