Virginia Gov. Bob McDonnell, right, during a news conference in Richmond, Va., on Jan. 8. (Bob Brown/AP)

Gov. Robert F. McDonnell on Monday ceremonially signed the landmark transportation-funding bill that will generate $1.4 billion a year for Virginia roads, highways and rail.

McDonnell (R) had previously signed the measure into law. With about 100 state legislators, business leaders and staff assembled behind him on the steps of the Capitol, the term-limited governor used the event to celebrate what could be his greatest legislative achievement.

The bill McDonnell signed was much larger and more laden with taxes than what he had proposed at the start of the General Assembly session in January — a fact he acknowledged in his remarks. But several officials who spoke said that the deal, which required compromises from both Republicans and Democrats, could not have come together without his push for a solution. McDonnell had admonished legislators to find a way to solve the problem the session — his last — was over.

“This bill is crucial to the future growth of Virginia’s economy, and this is a great day for job-creation in the commonwealth,” McDonnell said.

The law revamps the way Virginia raises funds for transportation, providing the first new revenue stream in nearly a generation to one of the nation’s largest and most congested road systems. Without the new infusion, the state’s road construction fund was on track to run out of money by 2017.

The law cuts the fuels tax but allows it to rise with inflation. It raises the sales tax from 5 percent to 5.3 percent and allocates a portion of existing revenue to roads. It also raises funds for regional authorities in Northern Virginia and Hampton Roads for transportation projects in those congestion-prone areas.

The law represented a compromise, with Republicans agreeing to higher taxes and Democrats agreeing to the use of some existing revenue, which would normally fund schools, health-care programs and public safety.

“This shows how government ought to work,” said Del. Robert H. Brink (D-Arlington).