The Senate approved a five-year, $305 billion highway bill Thursday, sending it to President Obama with just one day to spare before the scheduled expiration of the nation's road and transit spending.

The measure passed by a 83-16 tally, hours after sailing through the House on a lopsided 359-65 vote. The 1,300-page bill, paid for with gas tax revenue and a package of $70 billion in offsets from other areas of the federal budget, calls for spending approximately $205 billion on highways and $48 billion on transit projects over the next five years. It also reauthorizes the controversial Export-Import Bank’s expired charter until 2019.

Obama is expected to quickly sign the measure, which is the first long-term national transportation spending package in a decade and has been a priority this year for both the Obama administration and Republican leaders in Congress.

The legislation faced a potential last-minute snag over the inclusion of the $3 billion for crop insurance in the highway bill.

Sen. Jeff Flake (R-Ariz.) forced a vote on whether lawmakers should have been able to drop the provision — which wasn't included in the original House or Senate proposals — into the final deal while it was in conference.

"What we're doing here is targeting a specific provision that was airdropped into the highway bill," he added. "This isn't an attack on the highway bill."

But Sens. Barbara Boxer (D-Calif.) and James Inhofe (R-Okla.) warned that if Flake's push was successful, it would sink the highway bill with infrastructure spending set to run out Friday.

"If the highway bill is changed … it has to go back to the House," he said. "In other words, this issue is not whether or not or not how you feel about crop insurance; it's whether or not you want this bill."

Flake ultimately fell short, with Boxer telling her colleagues "I love everyone tonight" about those who voted with her to block the Arizona Republican's effort.

Senate Majority Leader Mitch McConnell (R-Ky.) praised lawmakers after passing the bill, suggesting senators have had to navigate around political and policy hurdles on the way to a long-term bill.

"We all had just all kinds of tripwires on the path to getting what we thought was important to the country — which was a multi-year highway bill," he said. "This has been one of the most exhilarating and satisfying experiences I've had in the time I've been in the Senate."

Sen. Mike Lee (R-Utah) slammed his colleagues who supported the highway bill, saying that "while the math may add up on paper,” the legislation includes "irresponsible and unsustainable funding mechanisms."

Congress has not passed a transportation funding bill that last longer than two years since 2005, much to the chagrin of infrastructure advocates in Washington.

Dubbed the Fixing America’s Surface Transportation Act, or the FAST Act, the new bill formally reauthorizes the collection of the 18.4 cents per gallon gas tax that is typically used to pay for transportation projects, and also includes $70 billion in "pay-fors” to close a $16 billion deficit in annual transportation funding that has developed as U.S. cars have become more fuel-efficient.

The gas tax has been the traditional source for transportation funding since its inception in the 1930s, but lawmakers have resisted increasing the amount that drivers pay. The federal government typically spends about $50 billion per year on transportation projects; the gas tax only brings in $34 billion annually.

Congress has been struggling for years to come up with a way to pay for a long-term transportation funding extension without raising the gas tax. The offsets in the agreement that was announced on Tuesday include changes to custom fees and passport rules for applicants who have delinquent taxes.

Additional mechanisms include contracting out some tax collection services to private companies — over the objection of unions that represent federal IRS workers — and tapping dividends from the Federal Reserve Bank.

Sen. Heidi Heitkamp (D-N.D.) praised her colleagues for including the reauthorization of the Export-Import Bank in the highway bill, adding that it is an "important step to show that Congress can work together across the aisle to stand up for American businesses and workers."