A tax that will increase the cost of gas by as much as 20 cents by 2016 was given final approval Friday by the Maryland Senate.

The bill passed largely along party lines by a vote of 27-20. Eight Democrats joined all 12 Republicans in opposing the tax increase measure. The bill now goes to the desk of Gov. Martin O'Malley, who is expected to sign the tax into law. The final vote came after legislators suspended the rules, allowing them to take both a preliminary and final vote in the same day and allow many lawmakers to leave the capital to observe Good Friday.

The bill increases the state's tax on gas by more than 20 cents to 43.7 cents per gallon on July 2016. The tax would increase to 44.6 cents per gallon if the federal government fails to pass an Internet sales tax. The tax is also tied to the consumer price index, allowing for automatic increases without any additional legislative action. Those increases are capped at 8 percent annually and do not go down if the consumer price index decreases in any given year.

Also in the bill is a $3.50 increase in the fee for vehicle registration. The fees will go to offset an increase in salaries offered to pilots for the Maryland State Police. The agency has 11 vacancies within its 50 pilot positions, according to the review of the bill.

The base pilot salary under the proposal would increase to $70,000 and the plan would cover the cost of hiring 20 additional pilots based on a review provided by the state Department of Legislative Services. Maintenance technicians would see their base salary increase to $60,000 as part of the proposal.

The bill also included:

$60 million over three years for the Sen. William H. Amoss Fire, Rescue, Ambulance fund.

A $2 per hour salary increase for field instructors at the Maryland Fire and Rescue Institute

More than $11 million over four years for a new communications system for the Maryland Institute for Emergency Medical Services.

A requirement that the governor spend nearly $400 million to comply with the Watershed Implementation Plan over five years. The Senate also passed 45-2 an amendment to the Maryland Constitution that creates stricter rules governing re-allocation of money from the transportation trust fund. The so-called lock box amendment requires that three-fifths of the legislature approve any plan that uses trust fund money for anything other than transportation projects. The gas tax bill contains a provision calling for a three-fifths vote of one House and one Senate committee.