The bill had already been approved by the House and President Obama was expected to sign it.
Only two senators were in the chamber for the vote, CBS said. But the bill, agreed to by Democratic and Republican leaders, was deemed to have passed unanimously.
The agreement "does not resolve the important differences that still remain," Senate Majority Leader Harry Reid, D-Nev., said in a statement Thursday. "But I believe we should keep Americans working while Congress settles its differences, and this agreement will do exactly that."
The two-week standoff cost the federal government more than $400 million in lost taxes on airline tickets.
Congressional officials said the deal extends the aviation agency's operations through Sept. 16, when both chambers will be back in session.
Most lawmakers left Washington this week on a five-week vacation.
Obama said he was "pleased that leaders in Congress are working together" to put tens of thousands of Americans back to work.
"We can't afford to let politics in Washington hamper our recovery, so this is an important step forward," he said.
Senate Democrats had refused to pass the House bill because it cut $16.5 million a year in the Essential Air Service, a subsidy program that ensures that small rural airports that had commercial air service before airline deregulation maintained commercial service.
The breakthrough came Thursday when Transportation Secretary Ray LaHood told congressional leaders he could issue waivers for the 16 communities affected by the House bill's cuts.
The White House had been coordinating discussions with LaHood, Reid, House Speaker John Boehner, R-Ohio, and others, The New York Times reported.