The Massachusetts Senate passed the latest version of a contentious transportation funding bill that would pump $800 million into the state's aging and debt-ridden transportation system.

The vote in the Senate was 30 to 5.

The senate debated the bill in a rare Saturday session. They waded through more than 110 amendments in 10 hours of debate.

The measure would raise about $500 million dollars in new tax revenue, mostly by increasing the gasoline tax by three cents a gallon and raising the cigarette tax by $1 per pack. The money would go to fix the state’s crumbling roads and bridges, and eliminate the MBTA’s annual operating deficit.

A similar measure was approved in the House on Monday in the face of a veto threat from Gov. Deval Patrick, who said the bill was insufficient to deal with the state’s long term transportation needs.

The Senate version of the bill would dedicate more revenue to transportation than the House passed version, something Patrick called a step in the right direction. But in a statement, he also said it was “concerning that some of the resources in this bill are diverted from current spending on other needs, such as education, the social safety net and environmental protection." Patrick stopped short of saying whether he would accept the Senate plan.

During opening remarks on the Senate floor, the Chairman of the House Ways and Means committee, Barre Democrat Stephen Brewer, urged his fellow senators to ignore the harsh rhetoric surrounding the bill.

“There’s been a lot of emotion and a serious case of hardball politics over the last couple of weeks," Brewer said. "I am very proud that during that time this body did not get caught up in emotion, but worked very hard to make a good piece of legislation even better.”

Brewer ticked off the improvements the bill would make:

“This bill solves the structural budget deficit at both the MBTA and Mass Department of Transportation. It dedicates more than $800 million in transportation for Fiscal Year 2018.”

Also, the Massachusetts Department of Transportation would stop borrowing money to pay the salaries of its 1,900 employees. This would free up new bond money for infrastructure improvements and expansion. And regional transit authorities outside of Boston that have to borrow money while they wait for state funds would start getting paid up front.

“Each of these improvements and accomplishments will improve our ability to provide our workforce and families with a reliable, convenient and affordale transportation system that enables our state to thrive.”

The Senate approved several amendments to the bill, including one that asks the MBTA auction off naming rights to subway stations so companies and universities could add their names to subway stops. For instance, JetBlue Boylston Station or Emerson Park Street Station.

Republicans offered an alternative transportation plan that would generate new revenue for the MBTA and transportation system without raising new taxes. For instance, they proposed letting solo drivers use the HOV lanes for a fee, and selling licenses for online gambling.

Outside the Senate chamber, Weymouth Republican Robert Hedlund said the state’s transportation problems could be solved without raising taxes.

"It raises taxes when I think we don't need to raise the revenues to the extent that the bill calls for, when in fact we've provided some alternative means to address the transportation funding shortfalls."

The bill now moves to conference committee.

Material from The Assosicated Press was used in this report.