"It's been a long time coming, but tonight... change has come to America," the president-elect told a jubilant crowd at a park in Chicago.
His rival John McCain accepted defeat, saying “I deeply admire and commend” Mr Obama. He called on his supporters to lend the next president their goodwill.
The BBC’s Justin Webb said the result would have a profound impact on the US.
“On every level America will be changed by this result… [it] will never be the same,” he said.
McCain: ‘We must work together’
Mr Obama appeared with his family, and his running mate Joe Biden, before a crowd of tens of thousands in Grant Park, Chicago.
“If there is anyone out there who still doubts that America is a place where all things are possible, who still wonders if the dream of our founders is alive in our time, who still questions the power of our democracy, tonight is your answer,” he said.
He said he had received an “extraordinarily gracious” call from Mr McCain.
He praised the former Vietnam prisoner of war as a “brave and selfless leader”.
“He has endured sacrifices for America that most of us cannot begin to imagine,” the victor said.
He had warm words for his family, announcing to his daughters: “Sasha and Malia, I love you both more than you can imagine, and you have earned the new puppy that’s coming with us to the White House.”
Congratulations… You are about to go on one of the great journeys of life
President George W Bush
But he added: “Even as we celebrate tonight, we know the challenges that tomorrow will bring are the greatest of our lifetime – two wars, a planet in peril, the worst financial crisis in a century.
“The road ahead will be long. Our climb will be steep… But America – I have never been more hopeful than I am tonight that we will get there.”
From red to blue
Mr Obama captured the key battleground states of Pennsylvania and Ohio, before breaking through the winning threshold of 270 electoral college votes at 0400 GMT, when projections showed he had also taken California and a slew of other states.
HAVE YOUR SAY I find myself strangely emotional about this. I want to go wake up my neighbours and hug them Amy Scullane, Boston
Then came the news that he had also seized Florida, Virginia and Colorado – all of which voted Republican in 2004 – turning swathes of the map from red to blue.
Several other key swing states are hanging in the balance.
In Indiana and North Carolina, with most of the vote counted, there was less than 0.5% between the two candidates.
However, the popular vote remains close. At 0600 GMT it stood at 51.3% for the Democratic Senator from Illinois, against 47.4% for Arizona Senator McCain.
The main developments include:
* Mr Obama is projected to have seized Ohio, New Mexico, Iowa, Virginia, Florida, Colorado and Nevada – all Republican wins in 2004.
* He is also projected to have won: Vermont, New Hampshire, Pennsylvania, Illinois, Delaware, Massachusetts, District of Columbia, Maryland, Connecticut, Maine, New Jersey, Michigan, Minnesota, Wisconsin, New York, Rhode Island, California, Hawaii, Washington, Oregon.
* Mr McCain is projected to have won: Kentucky, South Carolina, Oklahoma, Tennessee, Arkansas, Alabama, Kansas, North Dakota, Wyoming, Georgia, Louisiana, West Virginia, Texas, Mississippi, Utah, Arizona, Idaho, South Dakota.
* Turnout was reported to be extremely high – in some places “unprecedented”.
* The Democrats made gains in the Senate race, seizing seats from the Republicans in Virginia, North Carolina, New Hampshire, New Mexico and Colorado. They also increased their majority of the House of Representatives.
* Exit polls suggest the economy was the major deciding factor for six out of 10 voters.
* Nine out of 10 said the candidates’ race was not important to their vote, the Associated Press reported. Almost as many said age did not matter.
LOSSES AND GAINS
Projected gains for Obama in former Republican states of Ohio, New Mexico, Iowa, Virginia, Florida, Colorado, Nevada
Virginia: Democrat Mark Warner replaces retiring Republican John Warner
New Hampshire: Democrat Jeanne Shaheen unseats Republican John Sununu
North Carolina: Democrat Kay Hagan replaces Republican Elizabeth Dole
New Mexico: Democrat Tom Udall replaces retiring Republican Pete Domenici
Several states reported very high turnout. It was predicted 130 million Americans, or more, would vote – more than for any election since 1960.
Many people said they felt they had voted in a historic election – and for many African-Americans the moment was especially poignant.
John Lewis, an activist in the civil rights era who was left beaten on an Alabama bridge 40 years ago, told Atlanta’s Ebenezer Baptist Church: “This is a great night. It is an unbelievable night. It is a night of thanksgiving.”
Besides winning the presidency, the Democrats tightened their grip on Congress.
The entire US House of Representatives and a third of US Senate seats were up for grabs.
Democrats won several Senate seats from the Republicans, but seemed unlikely to to gain the nine extra they wanted to reach the 60-seat “super-majority”, that could prevent Republicans blocking legislation.