After years of stymied efforts to address the nation's aging and congested highways and transit systems, Congress found the sweet spot for passage on Thursday — a 5-year, $305 billion bill laden with enough industry favors, parochial projects, safety improvements and union demands to gain overwhelming support.

The bill was approved 359 to 65 in the House, and 83 to 16 in the Senate. The bill now goes to the White House for President Barack Obama's signature.

The bill boosts highway and transit spending and assures states that federal help will be available for major projects. It doesn't include as much money or last quite as long as many lawmakers and the Obama administration would have liked. Nor does it resolve how to pay for transportation programs in the long term.

Despite that, the 1,300-page bill was hailed by industry and public officials as a major accomplishment that will halt the cycle of last-minute short-term fixes that have kept the federal Highway Trust Fund teetering on the edge of insolvency for much of the past eight years.

Republicans leaders can point to the bill's passage as evidence of their ability to govern, and Obama can claim progress on addressing the nation's aging and congested infrastructure, a major goal since the early days of his administration. Lawmakers in both parties praised the bill as a model of bipartisan cooperation and an important step forward.

The bill "proves to the American people that we can get big things done," said Rep. Bill Shuster, chairman of the House Transportation and Infrastructure Committee. The committee's senior Democrat, Rep. Peter DeFazio of Oregon, called the measure "historic," but cautioned that "it is a starting point, not the end."

One hallmark of the bill is the creation of new programs to focus federal aid on eliminating bottlenecks and increasing the capacity of highways designated as major freight corridors. The Transportation Department estimates the volume of freight traffic will increase 45 percent over the next 30 years.

A big shortcoming in the bill, though, is how it's all financed. The main source of revenue for transportation is the trust fund, which comes mostly from the 18.4-cents-a-gallon gasoline tax. That tax hasn't been raised since 1993 even though transportation spending has increased. But raising the gas tax is viewed by many lawmakers as too politically risky.

To make up the shortfall, the bill uses about $70 billion in mostly budget gimmicks, including one that would move $53 billion from the Federal Reserve Bank's capital account to the general treasury. It's counted as new money on paper, but is actually just a transfer of funds from one government account to another, federal budget experts said.

Other items in the bill also don't include the means to pay for them, including more than $10 billion over five years for Amtrak and other rail programs, $12 billion for mass transit and $1 billion for vehicle safety programs. The money for those programs remains subject to annual spending decisions by Congress.

Among the bill's losers are large banks, which would receive lower dividends from the Federal Reserve, with the savings used for transportation programs. Banking officials complained that banks shouldn't be asked to foot the bill for highways and bridges.

The airline and cruise ship industries complained that their passengers are also being asked to pay for improvements unrelated to their travel. The bill ties customs fees to inflation and uses the increased revenue to offset the bill's cost. It also directs the sale of 66 millions of barrels of oil from the Strategic Petroleum Reserve in order to raise $6.5 billion. The catch is the sales don't start until 2023 — three years after the transportation bill it helps pay for has expired.

The trucking industry was able to persuade lawmakers to order the government to remove trucking company safety scores from a public website despite opposition from safety advocates. Industry officials say the government's methodology is unfair. But safety advocates won inclusion of a long-sought provision requiring rental car agencies to repair recalled cars and trucks before renting them.

The bill also addresses several concerns raised by a deadly Amtrak derailment in Philadelphia in May. It provides $200 million to help passenger railroads install positive train control technology that accident investigators say could have prevent the derailment had it been in operation. It also raises the liability cap on total damages that can be awarded in such crashes from $200 million to $295 million. The derailment killed eight people and injured nearly 200 others.

The Amalgamated Transit Union, which represents city bus drivers, won a provision requiring the government to direct transit agencies to take steps to protect bus drivers from assault, a growing problem. The Federal Transit Administration is required to consider whether local transit agencies provide bathroom breaks and access to bathrooms for bus drivers when evaluating the safety of the agencies.

A provision sponsored by Rep. Dina Titus, a Nevada Democrat whose district includes Las Vegas, authorizes the creation of a national advisory committee made up of travel and tourism industry officials to develop a national strategy for ensuring that transportation policies address the needs of travelers. Another provision sought by the dairy industry and sponsored by upstate New York, Connecticut and Wisconsin allows trucks hauling milk to exceed federal weight limits for interstate highways in some cases.