RICHMOND -- The Virginia Senate on Saturday reached a historic agreement that raises $880 million a year in new taxes and fees to fix roads and unclog congested highways in the D.C. region.

The plan, approved earlier by the House, now goes to Gov. Bob McDonnell, who becomes the first governor since 1986 to successfully push through the General Assembly a measure that raises new transportation revenues.

"This vote is an important moment for Virginia's economy, Virginians' quality of life and our political system," McDonnell said of the measure on which he hopes to build his legacy. "We have demonstrated that in Richmond we cut the rhetoric and we get results for the people."

The fragile bipartisan Senate alliance was nearly shattered at the last minute by Attorney General Ken Cuccinelli, a Republican candidate for governor.

Cuccinelli declared unconstitutional an 11th hour deal under which Democrats would back the transportation plan if McDonnell would support expanding Medicaid to provide health care for 400,000 low-income residents. Cuccinelli said the Medicaid expansion wouldn't stand.

Lawmakers scrambled Saturday just hours before they were scheduled to adjourn to rescue the deal. They ultimately determined that, contrary to Cuccinelli's ruling, they could legally empower a legislative panel to expand the state-federal Medicaid program once certain reforms are enacted.

The transportation compromise easily cleared the Senate 25 to 14, with eight Republicans joining 17 Democrats to pass it on the legislature's last day.

The final plan, which will raise $3.5 billion over the next five years for roads, could be a boon for Northern Virginia. The region will get an additional $350 million of the money raised. It also gets and additional $300 million to complete Metro's Silver Line to Dulles International Airport.

The compromise will eliminate the state's 17.5 cents-a-gallon gas tax and replace it with a 3.5 percent tax on wholesale gasoline and a 6 percent tax on diesel. It raises the state sales tax from 5 percent to 5.3 percent across most of the state and to 6 percent in Northern Virginia and Hampton Roads.

It will also cost more to buy a car, sell a home, stay a night in a hotel and own a hybrid vehicle.

A family of four in Northern Virginia with an income of $140,000 will pay an extra $18 a month, said Del. Dave Albo, R-Springfield.

"It's going to produce a lot of revenue," said Senate Minority Leader Dick Saslaw, D-Springfield. "The thing that makes it attractive are the regional packages [that allows Northern Virginia officials to raise additional funds]. Without that, you would have a lot of trouble getting support from a lot of us."

Opponents balked at raising the money through a sales tax increase.

"Why are we moving backwards to a deal that hurts non-drivers?" said Sen. Adam Ebbin, D-Alexandria. "We need a lot more money for transportation but not this way."