CHICAGO - In a major victory for gun rights advocates, a federal appeals court on 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 7th U.S. Circuit Court of Appeals said the ban was unconstitutional and suggested a law legalizing concealed carry is long overdue.

"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," said Judge Richard Posner, who wrote 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. They have long argued that the prohibition violates the U.S. 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 allowing concealed carry narrowly lost in the Legislature last year.

Gov. Pat Quinn, who favors strict gun control laws, was reviewing the opinion and did not have immediate comment, according to a spokeswoman. Attorney General Lisa Madigan, whose office is responsible for defending the state's laws in court, will review the ruling before deciding whether to appeal, said spokeswoman Maura Possley.

"The court gave 180 days before its decision will be returned to the lower court to be implemented," Possley said in a statement. "That time period allows our office to review what legal steps can be taken and enables the Legislature to consider whether it wants to take action."

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

Gun control advocates did not immediately respond to the ruling. But as other states passed concealed carry laws, they had argued that Illinois' ban was important in the national debate over gun control.

The country needs "one state people can look to and see it's still doing the right thing," Mark Walsh, director of the Illinois Campaign to Prevent Gun Violence, said last year.

The ruling Monday stems from a lawsuit filed by a former corrections officer, a farmer and the Bellevue, Wash.-based Second Amendment Foundation.