CHICAGO — Illinois adopted a law on Tuesday allowing residents to carry concealed guns, becoming the last state in the nation to permit some form of possession of guns in public.

The Illinois action was a significant political victory for the gun rights lobby, the National Rifle Association, which strongly supported the new law and lobbied hard for its passage.

Illinois was the last holdout among the states in prohibiting residents from carrying guns in public.

Gun control has been a hot national issue since 20 children and six adults were killed at an elementary school in Newtown, Connecticut, last December, prompting President Barack Obama to push Congress for tighter gun laws. However, Congress failed to enact a law supported by Obama that would have strengthened background checks for gun purchases.

In the state Obama considers home and where he served in the state Senate, the legislature voted to expand gun rights.

Democratic Governor Pat Quinn had objected to major parts of the concealed carry proposal. But both chambers of the state legislature voted on Tuesday to override his veto, allowing concealed carry to become the law.

The new law says that Illinois state police “shall issue” a permit to carry concealed guns to any applicant who passes a background check, takes 16 hours of required firearms training and meets other conditions. The bill would ban guns in some public places such as bars, schools and hospitals.

The Illinois legislature meeting in Springfield acted only after a federal appeals court last December ruled that the state prohibition on concealed carry violated the Second Amendment to the U.S. Constitution, which sets out the right to bear arms. The court gave Illinois until July 9 to enact a new law.

The issue of gun control divided the Illinois Democratic party, which holds large majorities in the legislature, along urban-rural lines. Some lawmakers from Chicago voted against concealed carry because they feared the new law would make it harder to control a wave of gun violence in the nation’s third largest city. Rural lawmakers, where hunting is popular, strongly supported concealed carry.

Quinn said the bill would endanger public safety, and he made a series of proposals to change it. Lawmakers considered some small changes to the bill suggested by the governor, but overruled him anyway.

Florida’s state social services agency investigated Nikolas Cruz’s home life more than a year before police say he killed 17 people at his former high school, closing the inquiry after determining that his “final level of risk is low,” despite learning that the teenager had behavioral struggles and was planning to buy a gun, according to an investigative report.