AUSTIN, Texas (AP) _ Texas surged toward allowing concealed handguns in public college classrooms, dorms and buildings with a key Senate vote Saturday, while much-watched legislative efforts to curb the rising costs of free college tuition for veterans and their families collapsed.

After negotiating a last-gasp agreement with the House, the Senate’s Republican majority approved the so-called “campus carry” bill over the objections of most Democrats, gun control advocates and some prominent higher education officials.

If approved by the House on Sunday, Gov. Greg Abbott is expected to sign the bill into law, taking effect Aug. 1, 2016. The legislative session ends Monday.

Campus carry has been one of the most contentious issues of the session. To get it through, supporters gave a major concession to worried campus officials by allowing colleges to carve out “gun free” zones at their schools.

Lawmakers agreed universities have unique areas such as hospitals, laboratories, daycare and grade school facilities where people shouldn’t be armed.

But while the bill allows college presidents to establish the gun-free zones, Senate Republicans warned they can’t just be sweeping bans on academic centers, dorms or student social areas.

“If universities violate the spirit of what we’ve done here, the Legislature will not be pleased,” said Sen. Brian Birdwell, R-Granbury, the author of the bill who negotiated the final version with the House.

By voting Saturday, the Senate avoided a threatened Sunday filibuster by Democrats.

Texas’ concealed handgun law currently bans weapons from college buildings and classrooms. Gun rights activists have tried to lift the ban since a campus shooter killed 32 people at Virginia Tech in 2007.

The move had been opposed by law enforcement, student groups and some influential higher education officials, most notably University of Texas System Chancellor William McRaven, the former Navy SEAL who directed the commando raid that killed Osama bin Laden.

McRaven told lawmakers allowing guns in classrooms would make campus “less safe,” make it more difficult to recruit and keep top faculty, and stifle free speech.

“I have concerns about introducing guns into a university environment already fraught with stress,” said Sen. Jose Rodriguez, an El Paso Democrat who voted against it.

Gun advocates say there will likely be very few concealed weapons on campus because most students won’t qualify for one. The state’s concealed weapons law requires license holders to be 21. Texas has about 850,000 concealed handgun license holders.

The bill passed Friday that allows license holders to visibly carry their handguns in a holster would not apply to campuses.

Lawmakers removed a provision from the campus carry bill that would have forced private universities to also allow guns at their schools.

Birdwell said lawmakers did not want to step on private property rights. State law allows property owners to prohibit weapons.

“Private schools are private property,” Birdwell said. “Starbucks sells coffee, private schools sell an education commodity.”

Meanwhile, lawmakers reached no deal on veterans’ benefits. It also has been an area of concern for universities, as costs have ballooned since 2009, when veterans’ children began being allowed to use unused credit hours.

Fiscal conservatives in the Senate muscled through major changes to reduce the program’s costs, but the House balked, saying it would hurt veterans. The chambers remained so far apart that no action will be taken.

The state estimates costs have risen from $24.7 million in 2010 to $169 million last year. More than half of those using the benefit are children of veterans, not veterans themselves.

Schools fear those costs will rise further after a judge ruled Texas can’t limit the benefits to veterans living in the state.

Lawmakers agreed to continue studying the issue and gave universities $53 million to help defray costs the next two years _ but many worry that won’t be enough.

With guns on campus all but settled and changes to the veterans education benefit stalling, lawmakers’ plates were far less full than they usually are with the final gavel looming. The House even adjourned early on Saturday afternoon.

Also Saturday, the Legislature’s Republican majority approved removing public corruption cases from a special prosecution unit based in liberal-leaning Austin and tied to former Gov. Rick Perry’s felony indictment last year.

If signed by Abbott, the bill would have the Texas Rangers investigate public corruption allegations. Prosecution of elected officials would move to their home counties.

Perry vetoed state funding for the Public Integrity Unit in 2013, after Democratic District Attorney Rosemary Lehmberg wouldn’t resign following a drunken driving conviction.

He was then indicted on abuse-of-power charges, but a special prosecutor, not the Public Integrity Unit, led that investigation.

The Legislature also approved a sweeping plan to potentially boost transportation funding by billions of dollars _ hoping to help clear the state’s traffic-clogged roads and highways.

The plan will ask voters statewide in November to amend the state Constitution and set aside $2.5 billion in sales tax money to roads and highways starting in 2017. Two years later, the state would divert a portion of vehicle sales tax revenue so that even more funding flows to roads.