Global Swiss bank UBS AG failed to settle U.S. charges of helping wealthy American customers dodge taxes, setting the stage for at least another five days of tense negotiations over a case that goes to the heart of Switzerland's famed bank secrecy laws.

There are still some issues that remain to be resolved. The parties are working through these issues and plan to continue talking, U.S. Justice Department attorney Stuart Gibson said on Friday.

The U.S. government is seeking the identities of thousands of wealthy American clients of UBS suspected of using offshore accounts at the bank to conceal assets and evade U.S. taxes. The dispute threatens to harm U.S.-Swiss relations.

Speaking in a teleconference with the judge presiding over the case, Gibson asked for the trial to be delayed another week to give negotiators time to strike a definitive out-of-court settlement.

Miami federal court Judge Alan Gold granted the request, giving the parties another 5 days to reach a deal and saying a trial could begin on August 17 if the parties fail to reach a deal.

The parties had been widely expected to announce a final settlement. It was not immediately clear what obstacles remained, although Swiss media reports said one sticking point was how to get the data about UBS' U.S. clients across to investigators fast.

Normally, any transmission of financial data from Switzerland to the United States involves potentially lengthy court appeals, and the Justice Department is believed to be looking for ways to cut down on such delays.

I am very surprised they have not resolved the issues, said Milan Patel, Geneva-based tax lawyer at Withers LLP.

There clearly is some impediment, which I suspect is on the Swiss side as they have to work out a carve-out that appears to not violate Swiss bank secrecy law, said Patel, a former official of the U.S. tax-collection agency IRS who is helping U.S. holders of secret Swiss accounts go through voluntary tax disclosure.

Swiss Justice Minister Eveline Widmer-Schlumpf said in a statement that negotiators will work intensively at the clarification of the details of the settlement.

The trial of a U.S. government lawsuit against UBS was originally scheduled for July 13. Gold agreed to delay it until August 3 to allow time for a settlement, then agreed to delay it until August 10 following an agreement in principle between the two sides, announced July 31.

Gold pressed to try the case by August 17, noting the scheduling constraints of his other trials. I'm not forcing it, but on the other hand if we're not there and you want more time, then we're into at least September 21, he said on the call.

State Department spokesman Robert Wood said he was not aware that the agreement in principle was in danger of falling apart.

UBS shares rose on Friday. They closed up 2.8 percent at 16.34 Swiss francs in Switzerland, and ended 2.3 percent higher at $15.11 in New York on a day when the DJ US Financials <.DJUSFN> was up 2.8 percent.

GLOBAL RIPPLES

The case has rippled across the global offshore banking industry because it marks the biggest legal challenge ever to Switzerland's bank secrecy.

Any settlement that involves the disclosure of any number of names raises serious questions about the viability of Swiss secrecy laws, Asher Rubinstein, a partner at law firm Rubinstein & Rubinstein, said in an emailed comment.

In February, UBS agreed to pay $780 million to settle criminal charges it was facing under a separate but parallel tax dispute with the U.S. government. It agreed to hand over data related to about 250 U.S. clients who held secret accounts and promised to close its offshore business to U.S. clients.

UBS' U.S. clients are believed to include many Americans with European roots who inherited substantial wealth; well-traveled businesspeople who received offshore compensation via Swiss accounts; and people whose main objective from the beginning in opening such accounts was to avoid taxes.

Some offshore accountholders facing investigation for tax evasion have already come forward to authorities in a voluntary disclosure program.

People who don't come forward are playing Russian roulette with the tax laws, said Charles Falk, an attorney in Mendham, New Jersey, who has handled over 60 voluntary disclosure cases. People who don't come forward are basically daring the IRS to find out about it.

Officials said the Swiss government rolled back its regulations to the limit to transfer the data without formally violating its laws, but tax lawyers said the case was a blow to bank secrecy.

Swiss banking rules have been under pressure for years and are gradually eroding. The Swiss government made concessions in March to abandon the distinction between tax fraud and tax evasion when dealing with foreign authorities.

Some 5.8 billion Swiss francs (about $5.4 billion) flowed out of UBS' Wealth Management America franchise in the second quarter, which the bank linked to the U.S. tax spat.

A successful deal with U.S. authorities could resolve UBS' troubles on this front, but not necessarily those of other global banks the U.S. Internal Revenue Service also may pursue.

The IRS has not specified which banks it could decide to go after, but has said they would be foreign-based like UBS.

UBS has 34,000 employees in the United States, more than rivals Morgan Stanley , Goldman Sachs Group Inc and Credit Suisse . It is the top share trader across the New York Stock Exchange and Nasdaq Stock Market combined.

(Reporting by Tom Brown; Additional reporting by Jim Loney in Miami, Lisa Jucca in Zurich, Juan Lagorio in New York; Additional writing by Jonathan Spicer and Christian Plumb in New York; Editing by Jim Loney, John Wallace, Gary Hill)