The Supreme Court justices, hearing a 2nd Amendment challenge to Chicago’s ban on handguns, signaled Tuesday that they were ready to extend gun rights nationwide, clearing the way for legal attacks on state and local gun restrictions.

The court’s majority appears almost certain to strike down a Chicago ordinance and rule that residents have a right to a handgun at home. Of U.S. cities, only Chicago and its Oak Park suburb have total bans on handguns. But many cities and states have laws regulating who can have a gun and where they can take it.

Gun rights advocates have said they’ve been waiting for the court’s ruling in this case to begin challenging gun regulations nationwide.

At one point in Tuesday’s argument, Chief Justice John G. Roberts Jr. noted the city’s lawyers doubted that people had a right to carry concealed weapons in public.

“Well, maybe that’s right,” Roberts said. But he quickly added that the question could be left for a future case, indicating that the court was not likely to sweep away additional gun regulations in this ruling.

But the clear message from the argument is that a five-member majority on the court thinks the right “to bear arms” is a fundamental right, like the freedom of speech, that cannot be unduly restricted by federal regulations, state laws or city ordinances.

Two years ago, the justices in a 5-4 decision struck down a similar handgun ban in the District of Columbia -- a federal enclave -- saying for the first time that the federal government is restrained by the 2nd Amendment from preventing an individual from having a gun for self-defense. In the Chicago case, the court is weighing whether to extend that protection to state and local jurisdictions.

In the ruling two years ago, the court also said reasonable regulations of guns were permitted in the District of Columbia. The tenor of Tuesday’s argument suggested it may take years of lawsuits to draw a line between an individual’s right to have a gun for self-defense and the government’s authority to set reasonable regulations.

Since 1982, Chicago has enforced a strict ban on handguns, even for law-abiding residents who want to keep one at home. The city’s lawyer argued Tuesday that throughout American history, cities and states have enforced restrictions on weapons without much interference from federal judges.

“Firearms are designed to injure and kill,” and cities need to regulate them to protect the public’s safety, James A. Feldman said.

But he ran into skeptical questions from the court’s leading conservatives, who referred to their decision in the Washington, D.C., case.

Shortly after that decision, gun rights advocates sued to challenge Chicago’s ban on behalf of Otis McDonald and several other city residents. The case forced the high court to confront a simple question it had never answered: Does the 2nd Amendment limit only the federal government’s authority over guns and state militias, or does it also give citizens nationwide a right to challenge their local and state gun laws?

Since the District of Columbia is a not a state, the court’s ruling in D.C. vs. Heller left that issue unresolved. But during Tuesday’s arguments, the justices who formed the majority in the D.C. case said they had already decided that gun rights deserved national protection.

Justice Anthony M. Kennedy said the individual right to bear arms is a “fundamental” right, like the other protections in the Bill of Rights. “If it’s not fundamental, then Heller is wrong,” he said, referring to the D.C. ruling, which he joined. Roberts and Justices Antonin Scalia and Samuel A. Alito Jr. echoed the same theme.

At one point, Justice John Paul Stevens proposed a narrow ruling in favor of gun rights. Two years ago, he dissented and said the 2nd Amendment was designed to protect a state’s power to have a “well regulated militia.”

Now, however, Stevens said the court could rule that residents had a right to a gun at home, but not a right “to parade around the street with a gun.”

A lawyer representing the National Rifle Assn. scoffed at the idea and opposed a “watered-down version” of the 2nd Amendment.

Scalia also questioned the idea. In his opinion two years ago, he described the right to bear arms as a right to “carry” a weapon in cases of “confrontation.” Such a right would not be easily limited to having a gun at home.

The justices will meet behind closed doors to vote this week on the case of McDonald vs. Chicago. It may be late June before they issue a written ruling.

david.savage@latimes.com