Republicans were nearly unanimous in opposing the plan that would expand coverage to tens of millions of Americans who lack it and place tough new restrictions on the insurance industry.
The 220-215 vote late Saturday cleared the way for the Senate to begin a long-delayed debate on the issue that has come to overshadow all others in Congress.
A triumphant Speaker Nancy Pelosi compared the legislation to the passage of Social Security in 1935 and Medicare 30 years later.
Obama, who went to Capitol Hill earlier on Saturday to lobby wavering Democrats, said in a statement after the vote, "I look forward to signing it into law by the end of the year."
"It provides coverage for 96 percent of Americans. It offers everyone, regardless of health or income, the peace of mind that comes from knowing they will have access to affordable health care when they need it," said Rep. John Dingell, the 83-year-old Michigan lawmaker who has introduced national health insurance in every Congress since succeeding his father in 1955.
But minority Republicans cataloged their objections across hours of debate on the 1,990-page, $1.2 trillion legislation.
"We are going to have a complete government takeover of our health care system faster than you can say, `this is making me sick,'" said Rep. Candice Miller, R-Mich.
In the run-up to a final vote, conservatives from the two political parties joined forces to impose tough new restrictions on abortion coverage in insurance policies to be sold to many individuals and small groups.
The legislation would require most Americans to carry insurance and provide federal subsidies to those who otherwise could not afford it. Large companies would have to offer coverage to their employees. Both consumers and companies would be slapped with penalties if they defied the government's mandates.
Insurance industry practices such as denying coverage because of pre-existing medical conditions would be banned, and insurers would no longer be able to charge higher premiums on the basis of gender or medical history. The industry would also lose its exemption from federal antitrust restrictions on price fixing and market allocation.
At its core, the measure would create a federally regulated marketplace where consumers could shop for coverage. In the bill's most controversial provision, the government would sell insurance, although the Congressional Budget Office forecasts that premiums for it would be more expensive than for policies sold by private companies.
The bill drew the votes of 219 Democrats and Rep. Joseph Cao, a first-term Republican who holds an overwhelmingly Democratic seat in New Orleans. Opposed were 176 Republicans and 39 Democrats.
From the Senate, Majority Leader Harry Reid of Nevada issued a statement saying, "We realize the strong will for reform that exists, and we are energized that we stand closer than ever to reforming our broken health insurance system."
To pay for the expansion of coverage, the bill cuts Medicare's projected spending by more than $400 billion over a decade. It also imposes a tax surcharge of 5.4 percent on income over $500,000 in the case of individuals and $1 million for families.