A day after six Philadelphia police officers were wounded in a long, tense standoff with a gunman, the city’s mayor angrily called for tougher restrictions on guns.

“I say to our state and federal lawmakers: Step up — or step aside,” Mayor Jim Kenney said, hours after the surrender of the suspect, who the police said had a lengthy criminal record.

The mayor said he had little choice but to plead: In Pennsylvania, cities are barred in many ways from setting tough gun restrictions on their own.

“Help our police officers. Help our clergy. Help our children,” Mr. Kenney told a room full of city officials and reporters on Thursday. “And if you choose not to help us, then get out of the way — and allow cities like Philadelphia that struggle with gun violence to enact our own solutions.”

Mr. Kenney’s remarks were the latest in a growing chorus of calls from local leaders for Congress to set stricter federal gun limits, following a series of shootings in American cities including deadly rampages in El Paso and Dayton, Ohio. Facing new pressure, President Trump and Republican leaders in Congress have voiced support for expanding the background check system for gun buyers, though local leaders and others are skeptical about the seriousness of that support.

Growing, too, are clashes between local officials and state lawmakers. Most states prohibit local governments from adopting nearly any gun regulation that would go beyond state law.

“They have pre-empted us totally in enforcing any type of regulation, including really simple legislation that would require someone to report a stolen or lost gun,” Mr. Kenney, a Democrat, said of the Pennsylvania State Legislature, which is dominated by Republicans.

The mounting tension among local, state and federal officials over gun laws and who should have the right to set them has not been limited to big-city leaders or those who favor gun control. In some rural counties in states like Illinois and Texas, local leaders have been adopting measures aimed at resisting limits on guns rather than tightening them. Some counties have proclaimed their communities “Second Amendment sanctuaries.” And some sheriffs in Washington State have said they would not enforce new state gun limits there.

Still, in some of the large American cities where crime and gun violence can be a daily problem, leaders said they were most frustrated by their own inability to set laws that make sense for their residents.

As of late last year, 43 states had pre-emption laws that bar local governments from enacting nearly any gun regulation that would go beyond state law. Pennsylvania is one of them: Its cities are allowed to adopt their own restrictions on the public carrying of firearms, but that is about it.

Advocates of those state pre-emption rules say they keep gun rights and regulations consistent across the state, so citizens can always know they are in compliance wherever they are. A patchwork of rules varying from city to city would only breed confusion, they say.

But many mayors say pre-emption laws tie their hands on a major issue facing their cities.

“It’s a constant problem, and it takes away local control,” Mayor Nan Whaley of Dayton, where nine people were killed this month in a mass shooting, said in an interview.

CreditMaddie McGarvey for The New York Times

Some states go even further. In Kentucky, it can be a misdemeanor punishable by jail time for a city official even to vote for a local gun ordinance that is more restrictive than state law. In Florida and Arizona, officials can be fined and removed from office for adopting such an ordinance.

In 1993, the City Councils of Pittsburgh and Philadelphia banned assault-style weapons within their limits. The State Legislature responded by passing a law that effectively repealed the ordinances, and state judges ruled that guns could be regulated only at the state level, not by municipalities.

The October 2018 attack on the Tree of Life synagogue in Pittsburgh, where a gunman killed 11 people, prompted the city to try again. The mayor signed legislation in April restricting the use of assault-style weapons within the city. But the legislation is being challenged in court, and it is not being enforced until the case is decided.

In Chicago, where street violence and gun deaths have been a significant problem, efforts to limit guns have been stymied by the courts and the state of Illinois. The city used to set strict limits, maintaining a gun registry from 1968 to 2013 and refusing to register any handguns after 1982, effectively banning civilians from keeping them in the city.

But in 2010, the Supreme Court held that state and local gun regulations, like federal law, were subject to the Second Amendment. Illinois responded with legislation that undid Chicago’s ordinance, leaving city officials furious and frustrated.

“The City of Chicago has tried many times on its own to institute legislation to try to restrict gun ownership in the city, and it’s gone up to the Supreme Court, and we’ve lost,” Lori Lightfoot, the mayor of Chicago, said in an interview. “So our ability is really tied to the willingness of the federal government to step up and do its job. And to date, that hasn’t happened. I do feel very frustrated, as a mayor, not to be able to unilaterally do more.”

Even when cities are able to adopt their own restrictive gun measures, the effects end at the city limits; weapons can still cross into cities easily from surrounding areas and nearby states with laxer rules. Ms. Lightfoot said Indiana — not far from Chicago — has been a constant source of guns that end up on Chicago’s streets.

[Read about a proposal in San Jose, Calif., to require gun owners, like car owners, to carry liability insurance.]

In Philadelphia on Thursday, Mr. Kenney said he had received supportive calls and text messages from other mayors as the city was grappling with the standoff on Wednesday, which kept a neighborhood on high alert for hours through a long night.

“The criminal yesterday was better armed than most of the police on the scene,” Mr. Kenney said in an interview. “That’s insane.”

Joshua G. Prince, a Pennsylvania lawyer who has litigated on behalf of gun rights groups, said the dangerous standoff in Philadelphia was not caused by insufficient regulation. “This was already a person who should not have been on the streets,” Mr. Prince said. “The laws on the books are not being enforced.”

But Mr. Kenney said new gun limits were urgently needed — and at this point, he said, the only way to set more gun limits was for Congress to take action.

“I think, in the end, if people like Mitch McConnell had to cower or crouch behind a Philadelphia police cruiser yesterday for seven hours, ducking AK-47 rounds, maybe he might think a little differently,” Mr. Kenney said, referring to the Senate majority leader.

“It’s not a matter of political ideology,” the mayor said, adding: “It takes more work and more effort to get a driver’s license in Pennsylvania than it is to buy a gun of any kind. And something’s wrong with that.”