Congress passed legislation to temporarily stave off looming cuts to doctors who treat Medicare patients, hours before the current government pay structure was to expire.

The Senate on Monday evening approved the $21 billion bill 64-35, four days after House leaders reached a last-minute compromise and passed the measure on a voice vote. Sixty votes were needed for the measure to pass.

President Obama was expected to sign the measure immediately.

"For the millions of elderly Americans and their doctors, this fix is good news," said Senate Majority Leader Harry Reid, D-Nev. "It means the promise of accessible, quality health care to our nation’s seniors is being honored for another year."

The so-called "doc fix" was the 17th time Congress has enacted a short-term extension, or "patch," to keep a 1997 budget-cutting law from biting too deeply into federal reimbursement payments for physicians who treat Medicare patients. If Congress hadn't acted, Medicare doctors would have seen their payments reduced by about 24 percent beginning Tuesday.

Letting the doc fix expire would save the federal government billions of dollars annually, but some doctors had threatened to stop seeing Medicare patients if their payments were cut.

Some lawmakers from both parties opposed the stopgap measure, which will extend payments to doctors for one year, in the hope of finding a permanent solution to the poorly designed Medicare payment formula.

But supporters said that voting against the temporary fix would hurt patients' care.

New Senate Finance Committee Chairman Ron Wyden, D-Ore., has vowed to continue to push for a permanent solution.

"You have to be concerned that after patch 17, there will be a patch 18, and after patch 18, there will be a patch 19," Wyden said on the Senate floor. "The reality is, if all you do is take what you got and extend it, we're not going to turn this situation around."

Wyden has suggested using savings from the winding down of the Afghanistan war to pay for an overhaul of Medicare's physician payment system. But Republicans say those savings are phony because the troop withdrawal long has been planned. Instead, they have demanded that savings come from  Obama's Affordable Care Act.

The bill allocates $16 billion to address Medicare physicians' payments and about $5 billion more for other expiring health care provisions, like higher Medicare payments to rural hospitals and for ambulance rides in rural areas.

The measure also gives Medicare doctors a 0.5 percent fee increase through the end of the year.