CHICAGO - In a major victory for gun-rights advocates, a federal appeals court Tuesday struck down a ban on carrying concealed weapons in Illinois - the only remaining state where carrying concealed weapons is entirely illegal - and gave lawmakers 180 days to write a law that legalizes it.

In overturning a lower-court decision, the U.S. Court of Appeals for the Seventh Circuit said the ban was unconstitutional and suggested a law legalizing concealed carry was long overdue in a state where gun advocates had vowed to challenge the ban on every front.

"There is no suggestion that some unique characteristic of criminal activity in Illinois justifies the state's taking a different approach from the other 49 states," Judge Richard Posner wrote in the court's majority opinion. "If the Illinois approach were demonstrably superior, one would expect at least one or two other states to have emulated it."

Gun-rights advocates were thrilled by the decision. They have long argued that the prohibition violates the Constitution's Second Amendment and what they see as Americans' right to carry guns for self-defense.

"Christmas came early for law-abiding gun owners," said State Rep. Brandon Phelps, a Democratic lawmaker from southern Illinois whose proposed legislation approving concealed carry narrowly lost in the legislature last year. "It's a mandate."

Gov. Pat Quinn, who favors strict gun-control laws, did not immediately comment. In a statement, an aide to Attorney General Lisa Madigan, who is responsible for defending the state's laws in court, said Madigan's office would review the ruling before deciding whether to appeal or take other action.

Richard Pearson, executive director of the Illinois State Rifle Association, said there was no reason lawmakers could not pass Phelps' bill during a weeklong legislative session in January.

Gun-control advocates did not immediately respond to the ruling. But last year, Mark Walsh, director of the Illinois Campaign to Prevent Gun Violence, said the country needs "one state people can look to and see it's still doing the right thing."