The Senate overwhelmingly passed legislation permanently overhauling how Medicare pays physicians late Tuesday in a rare show of near-unanimity from Congress.

The legislation headed off a 21 percent cut in doctors' Medicare fees that would have taken effect Wednesday, when the government planned to begin processing physicians' claims reflecting that reduction. The bill also provides billions of extra dollars for health care programs for children and low-income families, including additional money for community health centers.

Working into the evening, the Senate approved the measure 92-8 less than three weeks after the House passed it by a lopsided 392-37. 

The bill's passage brought statements of praise from both President Obama and Republican congressional leaders. 

"It's a milestone for physicians, and for the seniors and people with disabilities who rely on Medicare for their health care needs," Obama said in a statement before later adding "I will be proud to sign it into law."

Senate Majority Leader Mitch McConnell, R-Ky., said approval of the bill was "another reminder of a new Republican Congress that's back to work. And while no bill will ever be perfect, this legislation is a sensible compromise with wide bipartisan support; we look forward to the President following through on his commitment to sign it."

House Speaker John Boehner, R-Ohio, who crafted the compromise bill with House Minority Leader Nancy Pelosi, D-Calif., called the reform's passage "a big deal."

"For the first time in nearly two decades - and without raising taxes - Congress has come together in a bipartisan way to pass meaningful entitlement reform," Boehner added. "And while much more must be done to rein in unsustainable entitlement spending, this agreement represents an important step in the right direction."

Top Democrats in Congress also expressed support for the legislation.

"Tonight is a milestone for the Medicare program, a lifeline for millions of people," said Sen. Ron Wyden, D-Ore.

The bill's chief feature was its annulling of a 1997 law aimed at slowing the growth of Medicare that has repeatedly threatened deep cuts in reimbursements to physicians and led to threats by doctors to stop treating the program's beneficiaries. Congress has blocked 17 reductions since 2003, an exercise that invites intense lobbying and difficult choices about finding budget savings that both parties detested.

Instead, the measure would create a new payment system with financial incentives for physicians to bill Medicare patients for their overall care, not individual office visits.

While Democrats touted the legislation's added funds for children and the poor, Republicans were claiming victory in changes the bill makes in Medicare that would have a long-term though modest impact on the huge program's finances.

However, conservatives were unhappy that two-thirds of the bill's $214 billion, 10-year costs were financed by simply making federal deficits even bigger, while liberals wanted added money for children and women's programs. 

While $141 billion of the measure's costs over the decade would come from added federal red ink, about $35 billion would come from Medicare beneficiaries, mostly by raising the medical and prescription drug premiums paid by some upper-income recipients starting in 2018. Though the affected beneficiaries already pay higher premiums than lower-earning people, Congress seldom increases costs on seniors, fearing retribution come the next Election Day from older voters.

The bill would raise another $37 billion by cutting Medicare reimbursements to hospitals and other providers.

Before passage, senators rejected six amendments, three from each party, that were all but sure to lose but let lawmakers demonstrate their disapproval of provisions they opposed.

A Democratic proposal to extend the two years of extra money the measure provided for the popular Children's Health Insurance Program to four years lost on a 50-50 vote -- short of the 60 votes needed to prevail. By 58-42, the chamber rejected an effort by conservatives to force Congress to find enough savings to pay for the entire measure without increasing federal red ink.

Senators also faced conflicting pressures from lobbying groups.

The American Medical Association and other providers' organizations were urging lawmakers to pass the bill. AARP, the senior citizens' lobby, wanted legislators to back an amendment ending Medicare's annual coverage limits for therapy but stopped short of urging the bill's defeat without that change.

Conservative groups including the Club for Growth and Heritage Action for America pressed lawmakers to support the GOP amendment -- which lost -- to require Congress to pay for the entire bill.

The 21 percent cut in doctors' fees technically took effect April 1. Citing federal law, the Centers for Medicare and Medicaid Services stopped processing those claims two weeks ago -- in effect giving lawmakers time to complete the legislation. The agency processes around 4 million Medicare payments for doctors daily.

The Associated Press contributed to this report.