WASHINGTON (Reuters) - Legislation to avert a 25 percent pay cut for doctors treating patients covered by the federal Medicare health insurance program for the elderly won final U.S. congressional approval on Thursday.

On a vote of 409-2, the House of Representatives passed the measure, which the Senate approved the day before, clearing the way for President Barack Obama to sign it into law.

The legislation would provide a one-year “fix” to the doctor’s payment formula. It would stop a scheduled cut in physicians pay in January that advocates for the elderly say would have made it harder for Medicare patients to get medical care.

A number of health groups backed the legislation, including the 250,000-member American Medical Association.

“Stopping the steep 25 percent Medicare cut for one year was vital to preserve seniors’ access to physician care in 2011,” said the group’s president, Cecil Wilson.

“The AMA will be working closely with congressional leadership in the new year to develop a long-term solution to this perennial Medicare problem for seniors and their physicians,” Wilson said.

The bill was a compromise worked out by Democratic and Republican leaders as lawmakers make a final push to complete the legislative work of the current Congress by the end of next week. A new Congress will be seated in January when Republicans will take control of the House.

The $15 billion cost of the one-year pay fix for doctors treating Medicare and military Tricare patients will be paid for by changing a provision on recouping excess subsidy payments in the healthcare legislation enacted this year.

The government will be able to recover more excess insurance subsidy payments to individuals than provided under the existing law. The change will save $19 billion over the next 10 years, according to congressional estimates.

Obama backed the legislation but said it was time to enact a more permanent fix in the Medicare payment formula.

Doctors say the formula is outdated and would result in steep pay cuts that would discourage physicians from treating Medicare patients.

But changing the formula would add to long-term deficits. As a result, Congress for years has resorted to a series of short-term fixes that helped mask budget realities and made the long-term budget numbers look better.

Americans age 65 and older and disabled people are eligible for health coverage provided by the Medicare program.