"Today's vote answers the prayers of every American who has hoped deeply for something to be done about a system that works for insurance companies, but not for ordinary people," Obama said at the White House just before midnight.
"It's a victory for the American people and it's a victory for common sense," he added.
Al Jazeera's Rosiland Jordan, reporting from Capitol Hill, said the passing of the bill represented a landmark victory for Obama.
The US president was at his lowest point in public opinion polls, 15 months into his presidency, and there were questions about whether he would be able to accomplish anything on his domestic agenda if he could not get the healthcare bill passed, our correspondent said.
The passage of the bill was also a victory for Democrats, who can now cite it as an accomplishment when they face voters in midterm congressional elections in November, she added.
The 219 to 212 vote in favour of extending health insurance to nearly all American citizens came after days of negotiations and hours of heated debate.
The Democrats needed 216 votes to pass the bill and managed to secure more than that without a single Republican vote.
The bill now needs to be signed into law by Obama, who has staked his presidency on the legislation which provides health insurance coverage to 95 per cent of Americans, extending current coverage by 32 million people.
Obama put forward the proposal for the reforms in an attempt to get the bill passed after months of deadlock with opposition Republicans over the issue.
"This isn't radical reform, but it is major reform. This legislation will not fix everything that ails our healthcare system, but it moves us in the right direction ... this is what change looks like," Obama said.
The bill, which also bans insurers from denying coverage on the basis of pre-existing medical conditions and cuts deficits by an estimated $138bn over a decade, had previously passed votes in both the House of Representatives and the senate, but a reformed bill had to pass Sunday's vote and a later ballot in the senate.
The vote came hours after Obama and House Democratic leaders struck a last-minute deal with anti-abortion Democrats to secure the final few votes needed to pass the legislation.
Requires most Americans to have medical insurance
Bars denial of coverage due to a medical history
Prevents higher premiums due to health status or sex
Extends coverage to 15 million low income workers
Obama lobbied by phone from the White House, then took the crucial step of issuing an executive order that satisfied a small group of Democrats who demanded that no federal funds be used for elective abortions.
"We're well past 216," votes, said Bart Stupak, a Democratic Representative who got behind the bill after leading the anti-abortion holdouts in a rebellion that had left the outcome in doubt.
While national healthcare has long been a goal of presidents stretching back decades, it has proved elusive, in part because self-reliance and suspicion of a strong central government remain widespread in the US.
According to the latest Gallup poll, only 45 per cent of Americans support the healthcare reforms, and a shouting band of protesters outside the Capitol dramatised that opposition, with one man standing up in the House visitor's gallery shouting "kill the bill" before being escorted out.
Battle to continue
After more than a year of political combat that looks set to continue into the election campaign for control of congress later this year, debate on the House floor fell along predictable lines on Sunday.
Al Jazeera is not responsible for the content of external websites.
Louise Slaughter, a Democrat, said Republicans had "grievously and purposely lied to" the public in their efforts to defeat the legislation, in an apparent reference to Republican accusations that included the claim that there would be death panels for elderly patients.
David Dreier, a Republican, criticised the Democrats for their tactics on the House floor, but said, "the greatest outrage has always been for the bill itself", which Republicans say will cut Medicare for the elderly and raise taxes by nearly $1 trillion.
Republicans have vowed to repeal the bill if they win back majorities in the November elections.
Obama has said often that presidents of both parties have tried without success to achieve national health insurance, beginning with Theodore Roosevelt more than a century ago.
And Obama's own healthcare reform quest seemed at a dead end two months ago, when Republicans won a special election to fill the late Edward Kennedy's Massachusetts senate seat, and with it, enough Democratic votes to prevent a final vote.
But the White House, Nancy Pelosi, the House speaker, and Harry Reid, the senate majority leader, soon came up with a rescue plan that required the House to approve the senate-passed measure despite opposition to many of its provisions, then have both chambers pass a fix-it measure incorporating numerous changes.
Under the legislation, most Americans would be required to purchase insurance, and face penalties if they refuse.
Much of the money in the bill would be devoted to subsidies to help families at incomes of up to $88,000 a year pay their premiums.
|The latest Gallup poll says only 45 per cent of Americans back the reforms [EPA]
The legislation would also usher in a significant expansion of Medicaid, the federal-state healthcare programme for the poor.
The insurance industry would come under new federal regulation and be forbidden from placing lifetime dollar limits on policies, from denying coverage because of pre-existing conditions and from cancelling policies when a policyholder becomes ill.
Parents would be able to keep older children on their coverage up to age 26.
A new high-risk pool would offer coverage to uninsured people with medical problems until 2014, when the coverage expansion goes into effect.
Once enacted, the two bills would create a series of so-called "insurance exchanges" beginning in 2014 where self-employed people and small businesses could pool together to shop for healthcare coverage.
To pay for the changes, the legislation includes more than $400bn in higher taxes over a decade, roughly half of it from a new Medicare payroll tax on individuals with incomes over $200,000 and couples over $250,000.