Congress sent President Barack Obama a three-month bill to keep highway and transit money flowing to states on Thursday, one day before the deadline for a cutoff of funds.

Earlier in the day, the Senate passed a sweeping, long-term transportation bill, setting up discussions with the House this fall on what the future course of transportation policy should be and how to pay for programs.

The Senate approved the short-term bill by vote of 91 to 4. The House passed the same bill a day earlier, and then left for its August recess.

Lawmakers said they hope the 3-month patch -- the 34th short-term transportation extension since 2009 -- will be Congress' last. It extends the government's authority to process aid payments to states through Oct. 29. Without congressional action, that authority would have expired at midnight Friday.

The bill also provides $8 billion to shore up the federal Highway Trust Fund through mid-December. The fund's balance was forecast to drop below a $4 billion cushion necessary to prevent disruptions in payments to states in early August.

The extension bill also fills a $3.4 billion hole in the Department of Veterans Affairs' budget. The money gap threatened to force the closure of hospitals and clinics nationwide.

The $350 billion long-term bill, approved by vote of 65 to 34, would make changes to highway, transit, railroad and auto safety programs. However, its sponsors were only able to find enough money to pay for the first three years of the six-year bill. That's not as long as many lawmakers and the White House wanted, nor as much money, but it was enough to win the support of many state and local officials, transportation related industries, and labor unions who have been imploring Congress for years to pass to bill that will provide states the certainty that they can count on federal aid as they plan major construction projects.

The bill's passage is "a win for our country," said Senate Majority Leader Mitch McConnell, R-Ky. "Many thought we'd never get here, but we have."

Sen. Barbara Boxer, D-Calif., negotiated compromises with McConnell that helped pick up enough Democratic support for the bill for it to clear procedural hurdles and pass.

"We had to give some ground, but we found common ground," Boxer said. "And we all believe this bill is so important for our nation.

McConnell had tried to persuade the House to delay its recess in order to take up the Senate's long-term bill, but GOP leaders there opted for the short-term patch in order to give themselves time to craft a long-term bill that reflects their priorities.

The Senate's long-term transportation bill also renews the Export-Import Bank, which makes low-interest loans to help U.S. companies sell their products overseas. The bank's charter expired June 30 in the face of opposition from conservatives, who call it corporate welfare. A fight in the House over renewal of the bank is also likely.

The long-term transportation bill shores up the federal Highway Trust Fund for three years by using about $45 billion in revenue increases and making spending cuts elsewhere in the federal budget. The largest source of funds is $16 billion that would be saved by reducing the dividend rate the government pays to large banks.

The bill also attempts to speed up environmental reviews of construction projects and encourages states to impose user fees on electric vehicles because they use roadways but don't contribute to federal gas tax revenues. It also sets aside money for major projects and directs highway aid to major freight transportation corridors, starting with $1.5 billion in fiscal 2016 and increasing to $2.5 billion in 2021.

The safety provisions are the most controversial transportation part of the bill both for what they include and what they don't include. The bill requires that rental car agencies fix cars subject to safety recalls before renting them, but it doesn't include language sought by safety advocates requiring car dealers to fix recalled used cars before selling them. It would triple the amount the government can fine automakers who don't disclose safety defects or report consumer complaints from $35 million to $105 million -- significantly less than the $300 million sought by the White House. It would force the Federal Motor Carrier Safety Administration to conceal from the public its safety ratings of trucking companies; the trucking industry says the agency's methodology is flawed.