The Los Angeles City Council on Tuesday voted to repeal a law that compelled companies seeking city contracts to disclose whether they had ties to the National Rifle Association.

The vote comes after a federal judge in December blocked the city from enforcing the ordinance, which was passed last year. Council members voted 12-0 without discussion to repeal the ordinance.

The law had required companies seeking deals with Los Angeles to disclose contracts or sponsorships between them or their subsidiaries and the NRA.

Councilman Mitch O'Farrell pushed for the rules following a spate of U.S. mass shootings, including a November 2018 attack that killed 12 people at a bar in Thousand Oaks, Calif.

Last year, he said the law “provides transparency and allows the taxpayer to know how and where their monies are being spent,” according to the Los Angeles Times.

He had also said that the NRA had “been a roadblock to gun safety reform at every level of government for several decades.”

In a lawsuit seeking to block the ordinance, the NRA said the requirements violated the constitutional First Amendment right to free speech and association and the 14th Amendment right to equal protection.

In December, U.S. District Judge Stephen Wilson issued a preliminary injunction preventing the law from being enforced.

MEDIA’S BIASED COVERAGE OF GUN RALLY SHOWS LEFT’S AGENDA ‘TO DIVIDE THIS COUNTRY’: OKAFOR

NRA lawyer Chuck Michel called the repeal a "decisive victory" for the gun-rights group.

"Facing a trial where they'll have to account for the unconstitutional ordinance, city officials are now trying to mitigate the consequences of their illegal misbehavior," Michel said in a statement.

Rob Wilcox, a spokesman for City Attorney Mike Feuer, said in a statement that the reason Los Angeles was repealing the law "pertains to litigation." He did provide additional details.

CLICK HERE TO GET THE FOX NEWS APP

Supporters of the law maintained that Los Angeles shouldn't give public funds to NRA-linked contractors while the city tries to promote gun safety.

The Associated Press contributed to this report.