The measure continues unemployment benefits but cuts back their duration, and it keeps Medicare payments to doctors at their current rate.
The vote in the Senate was 60-36 and in the House 293-132, with some members of both parties opposing it, The Hill reported.
"Today, we took one important step in the short-term, Obama said at a Boeing plant in Everett, Wash.
"Congress did the right thing and voted to make sure that taxes won't go up on middle-class families at the end of this month. They also agreed to extend unemployment insurance for millions of Americans who are out there looking for a job, and I'm going to sign this bill right away."
The president said he wanted "to thank Congress for listening to the voices of the American people."
Obama said passing the bill "is just a start" because the country confronts "a set of economic challenges that existed even before this recession hit."
Presidential spokesman Jay Carney, speaking to reporters on Air Force One, said the president did not call members of Congress to lobby for the bill Friday.
"There was a good vote in the House today," Carney said.
Among Republicans in the House, the vote was 146-91 for the bill. Democrats voted for it 147-41.
The three Republican senators on the 20-member House-Senate conference committee that negotiated the compromise did not sign it. Some Republicans complained privately they were not fully involved in the talks, The Wall Street Journal reported.
The agreement keeps the Social Security payroll-tax withholding for 160 million workers at 4.2 percent -- a 2 percent cut worked out at the beginning of 2011 after the Obama White House negotiated a compromise tax plan with congressional Republicans -- lawmakers said. This lets the average worker earning $50,000 take home an extra $1,000 in pay over the year, lawmakers said.
The cost of the payroll-tax cut will not be offset with spending cuts, a major concession agreed to Monday by House Republicans. But the Social Security Trust Fund will still get the same money it would have received if the payroll-tax cut expired.
The deal calls for $93 billion projected to be lost to the fund to be fully replaced with money from the U.S. Treasury's general fund, lawmakers said.
The plan will increase the federal deficit $89 billion over 10 years, mostly through decreased tax revenue, the non-partisan Congressional Budget Office said.
The deal renews expiring jobless benefits, but cuts the maximum number of weeks to 73 from 99, lawmakers said. That part of the measure's roughly $30 billion price tag will be picked up by the sale of radio spectrum licenses and the federal worker-benefit changes.
The deal calls for Medicare to continue paying doctors at current rates, avoiding a 27 percent drop in physicians' fees, lawmakers said.
To help offset the $30 billion cost of paying doctors under Medicare, the agreement will reduce payments to hospitals.
McPhee, Cokas 'working on their marriage' after affair
Attkisson leaves CBS News, reportedly over network's 'liberal bias'