The Senate and the House of Representatives passed a bipartisan deal Friday extending the payroll tax cut and unemployment benefits while also avoiding a Medicare fee cut for doctors for the rest of the year.

The bill cleared the Senate in a 60-36 vote less than an hour after the House approved it by a 293-132 margin.

A majority of House Republicans and Democrats voted in favor of the bill, though 91 Republicans and 41 Democrats in the chamber voted no. Senate Democrats voted overwhelmingly for the bill while Senate Republicans largely opposed it.

President Barack Obama has promised to sign the legislation as soon as he ends his current trip to the West Coast, ending debate on the politically sensitive measures at least for the duration of the election.

"This is a big deal," the president told an audience in Washington state. "It is amazing what happens when Congress focuses on doing the right thing instead of just playing politics."

The roughly $100 billion payroll tax cut, a key part of Obama's economic recovery plan, has reduced how much 160 million American workers pay into Social Security on their first $110,100 in wages. Instead of paying in 6.2%, they've been paying 4.2% for the past year and two months -- a break worth about $83 a month for someone making $50,000 a year.

Without congressional action, all three measures would expire at the end of February.

Just Watched

Payroll tax cut explained

Just Watched

Congress reaches payroll tax deal

"Our founding fathers recognized that Washington would not always be united," said Rep. Dave Camp of Michigan, a top Republican involved in crafting the deal. "In their wisdom they knew that even divided government must still govern. And that is what we are doing here today -- governing and providing a solution to the very real problems Americans are facing in their daily lives."

"Today is a good day," declared House Minority Leader Nancy Pelosi, D-California. "This represents a victory for the middle class in our country."

House Speaker John Boehner, R-Ohio, on Thursday called the deal "a fair agreement and one that I support."

The agreement came together this week after House Republicans dropped a key demand Monday, saying they would accept the extended payroll tax cut without spending cuts elsewhere in the budget to cover the measure's roughly $100 billion cost.

According to the nonpartisan Congressional Budget Office, the agreement would increase the federal deficit by $89 billion over 10 years, mostly through decreased tax revenue. Numerous Republicans on Capitol Hill are vehemently opposed to any measure that increases the deficit. They are also concerned about diverting more revenue away from Social Security, and believe the unemployment insurance extension will discourage people from seeking work.

Boehner defended the decision to move forward with an unpaid extension, a move previously opposed by Republican leaders, by arguing it was the only way to prevent a tax hike demanded by Democrats to help pay the cost.

"We were not going to allow Democrats to continue to play games and cause a tax increase for hardworking Americans," Boehner told reporters Wednesday. "We made a decision to bring them to the table so that the games would stop and we would get this worked out."

"It's the art of a deal. I mean, it's a compromise," Rep. Steve Latourette, R-Ohio, said earlier in the week. "You have people that didn't get ... 100% of what they wanted."

The other two measures in the package -- the unemployment benefits extension and the so-called doc fix -- are estimated to cost a combined $50 billion. Unlike the tax cut, however, they will be paid for.

Funding sources to pay for the benefits extension and the doc fix include savings from broadband spectrum sales, increased pension contributions by new federal employees, and cuts to Medicare hospital and specialist fees that will not affect patients, according to the House Ways and Means Committee.

Several Democrats from Maryland and Virginia -- near Washington -- voted against the package because, they argued, it treats federal employees unfairly by requiring new government hires to contribute more to their pension.

Under the terms of the deal, in states with unemployment rates higher than the national average of 8.3%, the maximum time an unemployed person can receive benefits will drop from 99 to 73 weeks. The maximum length of benefits for people in states with an average unemployment rate or lower will drop to 63 weeks or as far down as 40 weeks.

The jobless have been able to collect up to 99 weeks of benefits since November 2009 as part of the nation's unprecedented response to the recession.

In addition, states will be allowed to perform drug tests on individuals applying for unemployment benefits if those people lost their previous job because they either failed or refused an employer's drug test. Individuals receiving unemployment assistance could also be tested if they are seeking a job that generally requires a drug test.

Also, welfare beneficiaries will be banned from accessing public assistance funds at ATMs in strip clubs, liquor stores, and casinos.

The current February expiration date for the payroll tax cut, the additional unemployment benefits and the doc fix were put in place by a short-term agreement reached by Congress in December. That agreement also set up the conference committee that resumed negotiations last month on a longer-term deal.

The debate over whether and how to extend the tax cut has been a political loser so far for the Republicans. Democrats have gleefully highlighted the GOP's reluctance to hold down the payroll tax rate, using the issue to portray Republicans as defenders of the rich who are indifferent to the plight of the middle class.

A number of conservatives have questioned the economic value of the tax reduction.

Political analysts believe the showdown over the payroll holiday has eroded GOP strength on the party's core issue of lower taxes. Fearing negative repercussions, Republican leaders have now backtracked on the issue twice: dropping their opposition to the two-month extension last December and dropping their insistence on paying for a longer extension on Monday.