Illinois would join the rest of the nation in allowing the carrying of concealed weapons under legislation approved by the General Assembly on Friday — hours before lawmakers were scheduled to adjourn for the summer and days before a federal court’s deadline.

The gun measure was a hard-fought compromise between gun rights activists across the state and gun control advocates trying to keep a lid on crime in Chicago. It now goes to Gov. Pat Quinn, a Chicago Democrat, who has not indicated whether he will sign it.

An 89-28 vote by the Illinois House on Friday sealed the compromise worked out after the federal appeals court ordered in December that Illinois end its ban on concealed carry by June 9. Earlier in the day, the Senate OK’d the plan 45-12. Both margins are big enough to withstand a gubernatorial veto.

Both critics and proponents of the measure said they were concerned about a lack of action before the court’s deadline. Past that point, no one knew what would happen, said Sen. Gary Forby, a southern Illinois Democrat who sponsored the final settlement.

“Some people (would say) ‘I can carry anything I want to,’” Forby said. “Some towns will say, ‘We can make laws and stop everything now.’ And no one will know, from Cairo, Ill., to Chicago, … what the law is.”

The plan would prohibit the possession of guns in such places as schools, taverns and parks, but would allow a gun to be kept securely in a car. It did not include an earlier proposal to eliminate all local gun ordinances, including Chicago’s current ban on assault weapons, but would curb local control on handguns and lawful transportation of firearms.

It would require the Illinois State Police to issue a concealed carry permit to any gun owner with a Firearm Owners Identification card who passes a background check, pays a $150 fee and undergoes 16 hours of training — the most required by any state.

On another gun matter, the Senate defeated a proposed ban on ammunition magazines that hold more than 10 rounds. Quinn and Senate Democratic leaders had pushed the initiative in Springfield alongside parents of three schoolchildren who were fatally shot in December at Sandy Hook Elementary School in Newtown, Conn.

But the measure was defeated in the Senate, 28-31.

Quinn referenced the Connecticut school shooting in a prepared statement, saying he was disappointed lawmakers didn’t snag the opportunity to “minimize the chance of this unthinkable violence happening in Illinois.”

On guns, Illinois has been long divided along geographic, as well as political, lines. Chicago Democrats rage against street violence while conservatives in other parts of the state, particularly southern Illinois, maintain loyalty to the Second Amendment.

But the need for a consensus rose in December, when the 7th U.S. Circuit Court of Appeals ruled that Illinois’ ban on concealed weapons is unconstitutional. All other states allow concealed carry, although 10 states have more restrictive laws than what is proposed in Illinois.

The Illinois House endorsed a more permissive plan last week, but it took the extra step of invalidating all local ordinances on firearms, including the Chicago ban on assault-style weapons, and drew the fierce opposition of Quinn, Chicago Mayor Rahm Emanuel, and Senate Democrats, who rejected it.

But Sen. Kwame Raoul, D-Chicago, a supporter of tougher restrictions, negotiated with House members and others to forge Friday’s compromise. It overrides local regulations on handguns or those that further restrict the ability of lawful gun owners to transport unloaded or broken-down weapons. It would leave other current ordinances intact, but ban future assault-weapons prohibitions.

Chicago got what it wished in terms of nearly two dozen specific places declared gun-free, including mass transit buses and guns. Emanuel said in a statement the bill “strikes a better balance between the rights of gun owners and the unique public safety needs of Chicago.”

Other Democrats complained the measure fell short.

“It’s too loosely written,” said Sen. Kimberly Lightford, a Maywood Democrat who argued for cities to be able to regulate guns based on their needs. “It doesn’t protect us at all.”

Raoul made concessions on carrying guns in establishments that serve alcohol. Residents would be allowed to carry guns into restaurants and other businesses that serve alcohol if liquor comprises no more than 50 percent of their sales. Rep. Ann Williams, D-Chicago, said guns and alcohol don’t mix.

“I don’t think there’s anything wrong if I want to go to Applebee’s … and sitting there, just having food, being able to protect myself and my family,” said sponsoring Rep. Brandon Phelps.

Phelps, a Democrat from Harrisburg in far southern Illinois, was also able to keep in a provision making automobiles a “safe harbor” — meaning a secured gun could be kept in a car, even if it’s parked in a prohibited place.