U.S. and Swiss negotiators were drenched in sweat when they finally settled their dispute over access to the names of American clients of UBS AG suspected of tax evasion, a source close to the talks said on Thursday.

The agreement, which could undermine Switzerland's cherished reputation for strict bank secrecy, was hammered out just hours before it was announced during a conference call with U.S. District Court Judge Alan Gold in Miami at 9 a.m. EDT (1300 GMT) on Wednesday.

It was initialed in a steamy Washington office at 2:45 a.m. (0645 GMT) the same day, capping the latest in a series of long-running and often bitter negotiations between Swiss and U.S. government officials.

They were over at the Mint Annex, which is kind of a satellite building for certain IRS people, said the source, who asked not to be identified because he had not been authorized to disclose details of the negotiations.

They turned the air conditioning off at 10 o'clock at night, he said, referring to the building in downtown Washington, which is known for its hot and humid summers.

They were all sweating pretty good, the source added.

He did not elaborate on the final round of negotiations involving officials from the U.S. Justice Department and Internal Revenue Service (IRS) but said the Swiss side in the talks had included many heavy hitters from Berne, including the deputy head of the Swiss federal office of justice.

Washington's case against UBS, the world's second-largest wealth manager, had strained relations between the United States and Switzerland because it challenged the latter's coveted bank secrecy laws and could lead to a breakdown in its tradition of bank confidentiality.

CASE TO BE DISMISSED

The head of the Swiss diplomatic service also played a role in the talks, but the source said the U.S. State Department was not directly involved.

Details of the agreement were not disclosed on Wednesday.

But a U.S. government source said on Thursday that Washington's case against UBS would only be dismissed once the final agreements were signed.

That could be as early as next week, although the timing is still uncertain.

An order from Judge Gold on Thursday, labeling the case administratively closed, was just a technicality and did not mean that it was all over.

The case will be dismissed by agreement of the parties, said the government source, referring to the fact that the Swiss and U.S. sides would still have to file a so-called Stipulation of Dismissal with Gold's court.

Lawyers following the case said the settlement could involve the disclosure to U.S. authorities of 3,000 to perhaps more than 10,000 names of American clients suspected of using offshore accounts to evade taxes.

That is less than the 52,000 names the United States originally hoped it could force UBS to disclose.

But U.S. tax experts and lawyers have said U.S. negotiators could still declare a major victory in the case if they came away with names from the original list believed to hold the biggest offshore accounts, and the bulk of the $15 billion in assets believed linked to U.S.-based clients of UBS.

(Editing by Pascal Fletcher and Gerald E. McCormick)