Dancers in New York have been told their pastime is not an expression that is protected by the constitution.
Dancing is barred in venues without a licence
A group of dancers had challenged a Prohibition-era cabaret law banning dancing in venues that do not have a special licence.
Judge Michael Stallman dismissed the dancers' claim, although he said New York should be "big enough to find a way to let people dance".
Authorities say the law is meant to protect residents from excess noise.
Under the 1926 legislation only venues with a special licence can allow dancing. Private, social dancing in restaurants, clubs and bars which do not have the licence is banned.
The Gotham West Coast Swing Club had claimed that the law unconstitutionally infringed on its right of free expression.
But Judge Stallman of New York County's Supreme Court dismissed the case for "a lack of any viable constitutional claim".
He also said clubs and restaurants that permitted dancing led to increased traffic and noise around the establishment.
However, he did concede that city authorities should re-examine the law to reflect current social norms.
"Surely the Big Apple is big enough to find a way to let people dance," he said.
Norman Siegel, a lawyer for the plaintiffs, said his clients were considering an appeal.
"We continue to believe that social dancing is expressive activity and should have state constitutional protection," he said. "We continue to believe the cabaret law is unconstitutional."
The plaintiffs claim that the number of places that legally allow couples to dance has fallen from around 1,000 in the 1960s to fewer than 300 today.