The House went first. After bitter partisan debate, it rejected pleas to clear the Senate's two-year, $109 billion highway bill and instead passed the extension.
The vote was 266 to 158, with 37 Democrats supporting the extension and 10 Republicans voting against it.
House leaders intend to use the three months to get agreement on the five-year, $260 billion bill that has been stalled by objections from some conservative Republicans as well as most Democrats.
The Republicans don't like the spending levels in the bill, which would use funds raised from new oil and gas drilling to supplement the Highway Trust Fund. Democrats object to the drilling, among other provisions.
In the argument leading up to the vote, Rep. Peter DeFazio, D-Ore., referred to the conservative Republicans who object to the bill as "bozos." Rep. John Mica, R-Fla., called for the House physician to treat Democratic members who were suffering from "amnesia" because they seemed not to remember passing extensions when they were the majority.
The Senate had been pushing for its measure, which cleared earlier this month on a lopsided bipartisan vote - a rarity these days.
However, the current extension is due to end midnight Saturday, and with no bill, the highway program and the federal government's ability to collect the fuel taxes that fund highway construction and maintenance would have come to a screeching halt.
So the Senate reluctantly passed the House extension.
This sets up a rematch by the end of June. If the House is able to come to terms on a bill it can pass, with or without Democratic support, its measure will then have to be reconciled with the Senate bill.
Although the two bills are similar in the way they approach important program reforms at the Department of Transportation, the conflicting terms and funding mechanisms will present serious obstacles.
Meanwhile, state transportation departments will have to keep holding their breath for a long-term highway program. Uncertainty has caused a number of states to delay billions of dollars in highway projects, said John Horsley, executive director of the American Association of State Highway and Transportation Officials.
"The clock has been reset, and we are optimistic that the House and Senate will use the time available to settle on a new, long-term reauthorization," Horsley said in a statement.