SPRINGFIELD, Illinois (Reuters) - Illinois lawmakers on Friday approved a measure that permits residents to carry concealed guns, which if signed by the governor would make some form of carrying a concealed weapon legal in all 50 states.

Illinois is the only state in the nation to ban most people from carrying a concealed gun outside the home and lawmakers are up against a deadline to approve a bill after a federal appeals court struck down that ban as unconstitutional.

The appeals court said the ban violated the right to bear arms under the U.S. Constitution and gave Illinois until early June to pass a law that would meet constitutional protections.

Last week, the House approved a bill that included a clause that would have overturned Chicago's ban on assault weapons, raising objections from senators, the city and governor.

A revised bill passed on Friday with a 45-12 Senate vote and a 89-28 House vote that allows Chicago to keep its ban on assault weapons, but requires America's third-largest city to allow citizens to carry concealed weapons.

The bill now goes to Governor Pat Quinn but passed both the state House and Senate with enough votes to override a veto.

If he signs it, the National Rifle Association would achieve a long-time goal of ending the Illinois ban and making some form of concealed carry legal in all 50 states.

State Senate President John Cullerton said no one would be fully satisfied, but lawmakers had sought an appropriate compromise.

"Failure to pass this bill would result in unregulated and unsafe communities across the state," he said in a statement.

Concealed carry laws faced opposition from many lawmakers who represent Chicago, where police say gun trafficking has led to a surge of violence and a rise in gang-related shootings.

The expansion of gun rights in President Barack Obama's home state stands in contrast to efforts to put more controls on guns following the Newtown, Connecticut, school massacre last year.

Current Illinois law bans the carrying of concealed weapons by virtually everyone except police and security guards, hunters and members of target shooting clubs.

The measure bans guns in bars where more than 50 percent of sales are from liquor, as well as at festivals and in many other places including schools, child-care facilities, parks and government buildings.

All other states allow some concealed carry. Some, such as New York, have strict requirements. Others, such as some western states, do not require permits at all.

(Reporting by Joanne von Alroth in Springfield, Karen Pierog in Chicago and David Bailey in Minneapolis; Editing by Lisa Shumaker)