New York City’s bizarre Cabaret Law was finally laid to rest on Halloween, at the ripe old age of 91.

Cause of death? Common sense.

The law, enacted in 1926 (i.e., at the height of Prohibition, as well as the Harlem Renaissance), infamously prohibited dancing in bars and clubs that had not obtained a cabaret license. It was unevenly enforced and often amended over the years, but nonetheless remained on the books until city council repealed it by a resounding 44-1 vote at its Oct. 31 meeting.

At different points during its long (and in many eyes, troubling) history, the law effectively muzzled jazz luminaries like Charlie Parker, Billie Holiday, and Thelonius Monk, and turned Frank Sinatra into an activist. Rudy Giuliani weaponized the statute. Others have bristled over it, but until this year it survived many repeal attempts.

Finally Rafael Espinal, a councilman from Brooklyn, introduced a bill quashing it, pending the approval of mayor Bill de Blasio.

“It’s great to see how excited the city is,” the 33-year-old Espinal told the New York Times. “We have shown that there’s an appetite for expanding dancing around the city.”

The law applies only to clubs located in areas zoned for commercial manufacturing; as the Times reported, zoning laws will have to be altered for dancing to be permitted in other parts of the city.

The repeal is in some ways academic. Because of the Byzantine (and costly) application process, few establishments even bothered to obtain a cabaret license. The Times reported that only 97 of some 25,000 spots had one, while a 2016 anti-Cabaret Law petition put that number at 118.

And as mentioned, enforcement has been spotty, though as recently as 2013 club owner Andrew Muchmore was assessed a Cabaret violation when some of his patrons engaged in what was described as “unlawful swaying” during a rock show at his night spot. He responded by filing suit against the city, dropping it only when the law was repealed.

The law was originally enacted to regulate the speakeasies that cropped up during Prohibition, though it is widely suspected that the real purpose was to crack down on jazz clubs, where mixed-race crowds often congregated.

A 1940 amendment also required musicians to obtain cabaret cards, a process that called for fingerprinting, interrogation, and renewal every two years. Parker, Monk, and Holiday were denied cards for one reason or another, and thus barred from performing. Sinatra, citing the demeaning nature of the application process, declined to appear as well, in a show of solidarity; that led to the repeal of the cabaret-card system, albeit after it had been in place for 27 years.

Other permutations of the law prohibited wind, percussion and brass instruments (i.e., the type of instruments used by jazz bands) or barred musical groups numbering more than three from appearing on stage. Those restrictions were eased in 1986 and 1988, respectively.

During Giuliani’s term as mayor (1994-2001), he used the Cabaret Law to crack down on so-called nuisance clubs. One club owner went so far as to say Giuliani’s tactics were reminiscent of a “Gestapo state,” but Giuliani, amid his “quality of life” initiative, argued that he was dealing as best he could with establishments that dealt in illegal activities (particularly drug-dealing), as well as those that had become a nuisance to their neighborhoods because of noise, unruly behavior, littering, etc.

The law has also been used in recent years to ensure that clubs were up to snuff in regards to fire safety and security, though its critics have argued that other regulations (and regulatory boards) were in place to deal with those issues.

So the law died a peaceful death. And everyone was only too happy to dance on its grave.