Mayor Eric Adams signed new legislation Tuesday banning guns in Times Square, even as a recent court ruling declared such a prohibition to be unconstitutional.

The legislation, which follows from a state law that banned firearms in the tourism, commerce and theater hub, bounds the gun-free area as stretching from 40th Street to 53rd Street between 6th and 9th Avenues, including the Port Authority Bus Terminal. 

Adams said the bill was necessary because of the volume of people who visit Times Square, so as to prevent legal gun owners in the area from firing their weapons if a gunshot goes off.

“This is not an assault on gun owners,” Adams said. “This is an assault on making bad decisions that can impact the lives of innocent people.”

Yet in a decision issued last week, a federal judge blocked a state law that prohibits guns in a wide range of spaces, including Times Square. The judge, however, stopped his order from being implemented until an appeals court could weigh in. If the appeals court takes on the case, it could allow the state law to stand until its justices have made a decision.

The state law was designed to replace an earlier law that the Supreme Court found unconstitutional in June. The new law, passed weeks after the Supreme Court decision, prohibited all guns in certain areas except with specific authorization from local law enforcement. 

The judge, Glenn T. Suddaby, who was appointed in 2008, said that much of the new state law was unconstitutional based on the Supreme Court’s ruling. The state, he said, could not prohibit guns from Times Square, public transportation, entertainment venues, museums, zoos, health care providers, homeless shelters and summer camps. 

Suddaby’s ruling permitted the prohibition of firearms in government buildings, courthouses, polling places, schools and for temporary government events or protests. Religious centers can also choose to outlaw firearms. 

Stephen Louis, a city lawyer, said they expected a decision from 2nd U.S. Circuit Court of Appeals on whether it will take up the case, and whether it will allow the state law to stand, by tomorrow.

“Until they make some further determination, we will continue to enforce the law,” Louis told reporters after Adams signed the legislation. “Right now we just have to wait and see what happens.”

On Tuesday, New York Attorney General Letitia James filed a motion with the federal appeals court to keep the state law that prohibited guns in certain areas, called the Concealed Carry Improvement Act, (CCIA) in effect throughout the appeal process.

Without further action from the appeals court, Suddaby's order blocking the CCIA goes into effect Wednesday.