The Swiss Federal Department of Justice and Police said it was illegal for UBS to do so and that, "if circumstances require, the FDJP will issue a corresponding order. The order prohibits UBS explicitly from handing over client information."
Switzerland and U.S. authorities have clashed over the demand for information that could show Americans attempting to dodge tax.
UBS has already paid a $780 million fine and disclosed hundreds of client names to prevent criminal charges.
And the Swiss government has agreed to redraft its tax treaties. See full story.
But the case has now moved to a Miami court, which is hearing the demand for the additional client information.
The U.S. has said that Swiss banking secrecy isn't an excuse for UBS to intentionally help Americans evade tax.
UBS has been hit by billions of dollars in net outflows on a combination of nervous investors unwilling to hold their money and the inability to bring in new cash.
Many analysts say the court battle is a prelude to a settlement. A Swiss newspaper estimated that UBS could pay as much as $4.6 billion to settle the dispute.