Kansas lawmakers passed and sent to Gov. Sam Brownback a bill on Thursday that would exempt publicly owned hospitals, mental health centers, adult care homes and health clinics from having to allow people to bring concealed firearms into those facilities starting July 1.

But the bill would leave in place a requirement that public colleges and universities have to begin allowing concealed carry on that date.

Lawmakers in both chambers said they have been told Brownback has agreed to sign the bill, but his office did not confirm that to reporters.

The Senate took up the bill first and debated more than four hours before voting 24-16 to send the bill to the House. A few hours later, the House voted overwhelmingly, 91-33, to send the bill to the governor.

Those votes came despite strong lobbying by the National Rifle Association to scale back the bill.

The bill would allow Lawrence Memorial Hospital as well as the Bert Nash Community Mental Health Center and the University of Kansas hospital to continue banning guns in their buildings.

It also applies to state psychiatric hospitals as well as municipally-owned hospitals, indigent care clinics, community mental health centers and adult care homes.

Republican leaders in both chambers had been reluctant to debate gun legislation, saying there were ongoing negotiations between the NRA and groups wanting to limit the concealed-carry mandate, which goes into full effect July 1. But those negotiations failed to produce a compromise that all parties would accept.

Senate President Susan Wagle, R-Wichita, carried an amendment that she said the NRA supported and that Gov. Sam Brownback would sign. It would have limited the exemption just to patient-care areas of the KU hospital and the four state psychiatric hospitals, but it still would have allowed concealed-carry in the parking lots and public reception areas of those facilities. Beyond those points, the Wagle-NRA amendment would allow those facilities to require people to store guns in a locker.

“It’s not everything that KU Hospital wanted. They want a gun-free zone,” Wagle said. “But in 2013 we passed a law that said look, our policy is that if you have a state-funded and supported facility, we value the rights of law-abiding gun owners, and if you’re going to put in a state facility, if you’re going to ban guns, then provide security for people who would normally carry a gun to protect themselves and others from harm.”

Supporters of the current law have long argued that gun bans only prevent law-abiding people from taking guns into buildings because “stickers on the door” do not deter people with criminal intent.

But even senators who have strong pro-NRA ratings voted against that amendment, including Senate Republican Leader Jim Denning, of Overland Park.

Denning said the KU hospital and medical school, which are co-located in the same buildings, have to compete both regionally and nationally to recruit top researchers and faculty, and that many would not come to KU if it’s required to allow concealed firearms.

“Let them have their stickers on the door if it makes the folks who work there want to work there,” he said. “It’s about health care. It’s really not about anything more than that. It’s working fine.”

Wagle touted the amendment as a compromise, adding that the NRA didn’t need to negotiate because the Legislature passed its bill in 2013. But Senate Democratic Leader Anthony Hensley, of Topeka, said it didn’t meet the definition of “compromise” because the NRA was the only party that agreed to it. Neither KU, the Kansas Hospital Association nor the community mental health clinics supported the proposal.

The Wagle-NRA amendment failed, 16-24.

Wagle said during the debate that she has been told that Brownback will veto any bill other than the one backed by the NRA. But Sen. Carolyn McGinn, R-Sedgwick, who chairs the Ways and Means Committee where the bill originated, said Brownback had committed to signing that bill, if it comes out of the Legislature clean, with no other amendments.

The Ways and Means Committee, which typically deals with budget issues, initiated the gun debate after the Department on Aging and Disability Services requested $25 million over the next two years to install metal detectors and security guards at the four state psychiatric hospitals. That cost figure was later reduced to about $12.5 million, plus ongoing operational costs.

Under a law enacted in 2013, publicly-owned facilities other than K-12 public schools must either allow people to carry concealed firearms or provide adequate security to prevent anybody from bringing weapons into those buildings. The governing bodies that manage those buildings were allowed four years to come into compliance, a window that expires June 30.

During lengthy debate, the Senate also rejected an amendment that would have extended the exemption for public college and university campuses.

Sen. Tom Hawk, D-Manhattan, whose district includes the Kansas State University campus, said he supported the idea, but voted against the amendment because it would have killed the bill’s chances of passage.

But Sen. Marci Francisco, D-Lawrence, said she had to support it.

“My district includes the University of Kansas campus, Lawrence Memorial Hospital and Bert Nash Community Mental Health Center,” she said. “All of them are important to me. Representatives of all those facilities have urged me repeatedly to work against the bill that was passed four years ago. … It’s impossible for me to choose between my constituents.”

That amendment failed on a vote of 5-29. Sixteen senators did not cast a vote on the amendment.

The Senate put the language of its bill into a House bill that originally dealt with the city of Valley Center and its desire to deannex a publicly-owned cemetery, a legislative maneuver known as “gut-and-go.”

That meant that when the Senate sent the bill over to the House, the full House could simply vote to concur with the Senate change.

Strong gun-rights supporters in the House attempted to thwart the move by seeking to send the bill to a conference committee, which effectively would have killed the bill. But it was evident early on that they were badly outnumbered in the chamber.

Rep. John Whitmer, R-Wichita, joked about that when he spoke in favor of a motion to kill the measure.

“To my colleagues on the other side of the aisle, I apologize for what has happened to you in previous years, when Republican conservatives were in the majority, because this sucks,” Whitmer said.

Rep. John Barker, R-Abilene, who chairs the Federal and State Affairs Committee that considered a similar bill, voted in favor of passing it Thursday, even though he did not push to move the committee’s own bill during the session.

“It was a tie vote. I was the deciding factor, I chose not to vote because I wanted to work some compromise,” he said after the vote. “That did not happen.”

Although Republican leaders had been saying for weeks that the NRA was negotiating on a compromise, Barker said its lobbyists never approached him, even though he chairs the committee that deals with gun issues.

Rep. Barbara Ballard, D-Lawrence, said she was pleased with the outcome, even though the bill does not include an exemption for college and university campuses, which she strongly supports.

“That’s a totally separate issue,” she said after the vote. “It’s a big bite to think all of that’s going to happen.”

Ballard also suggested there may be another vote before the session ends to exempt higher-education campuses.

“It probably won’t be an easy one, but I will say to you there will probably be some vote on campus carry,” Ballard said.