NEW YORK (Reuters) - New York City may enforce a 2001 law to reduce the number of bookshops, dancing clubs and video stores offering sexual content, without violating owners’ First Amendment rights, New York state’s highest court ruled unanimously on Tuesday.

A sex shop is seen open near Times Square in New York October 29, 2012. REUTERS/Carlo Allegri

The Court of Appeals’ 5-0 reversal of a lower court ruling handed the city a major victory in its two-decades-long effort to stop the proliferation of “adult” establishments.

“It is evident as a matter of law that the city met its burden of showing that the adult establishments continued to have a predominant focus on sexually explicit materials and activities,” making the law “facially constitutional,” Judge Eugene Fahey wrote.

Erica Dubno, a lawyer representing various adult business owners, and Edward Rudofsky, a lawyer representing the Pussycat Lounge and Ten’s Cabaret, said they were disappointed with the decision and would review their clients’ options.

Nick Paolucci, a spokesman for the city’s law department, said the decision shows the city “acted reasonably and lawfully to stem the widespread circumvention of zoning regulations intended to protect our quality of life.”

The 2001 law sought to plug a gap created six years earlier, when the City Council banned dancing clubs and erotic stores from residential and most commercial areas, and from within 500 feet of similar businesses, schools and places of worship.

Those restrictions were adopted as part of Mayor Rudolph Giuliani’s focus on quality of life issues, including crime.

Following a court challenge, the city in 1998 created the “60/40” test, deeming businesses “adult” if at least 40 percent of their area or stock involved sexual content.

But it soon found many businesses in “sham” compliance, often by stuffing PG-rated videos in back rooms while focusing on X-rated wares.

In 2001, the city decided that businesses offering specific services, such as topless dancing or peep booths, would qualify automatically as “adult.”

That would have required many businesses to close or move.

A Manhattan judge found the law unconstitutional in August 2012, and was upheld by a divided state appeals court in July 2015.

But Fahey said the appeals court’s “rigidly mechanical” approach defeated the city’s substantial interest in curbing sex shops, and ignored how “quintessentially sexual activity” such as lap dances could qualify businesses as “adult.”

Ed Anakar, director of operations for a unit of Rick's Cabaret parent RCI Hospitality Holdings Inc RICK.O, with three Manhattan locations unaffected by the outcome, said the decision "can make it difficult for 60/40 locations to continue operations."

The case is For the People Theatres of N.Y. Inc et al v. City of New York, New York State Court of Appeals, No. 59.

(This version of the story corrects vote to 5-0, not 6-0 in paragraph two)