The son of a black father from Kenya and a white mother from Kansas, the Democratic senator from Illinois sealed his victory by defeating Republican Sen. John McCain in a string of wins in hard-fought battleground states-Ohio, Florida, Virginia and Iowa.
A huge crowd in Grant Park in Chicago erupted in jubilation at the news of Obama's victory. Some wept.
McCain called his former rival to concede defeat-and the end of his own 10-year quest for the White House. "The American people have spoken, and spoken clearly," McCain told disappointed supporters in Arizona.
Obama and his running mate, Sen. Joseph Biden of Delaware, will take their oaths of office as president and vice president on Jan. 20, 2009.
As the 44th president, Obama will move into the Oval Office as leader of a country that is almost certainly in recession, and fighting two long wars, one in Iraq, the other in Afghanistan.
The popular vote was close, but not the count in the Electoral College, where it mattered most.
There, Obama's audacious decision to contest McCain in states that hadn't gone Democratic in years paid rich dividends.
Obama has said his first order of presidential business will be to tackle the economy. He has also pledged to withdraw most U.S. combat troops from Iraq within 16 months.
Fellow Democrats rode his coattails to larger majorities in both houses of Congress. They defeated incumbent Republicans and won open seats by turn.
The 47-year-old Illinois senator was little known just four years ago. A widely praised speech at the Democratic National Convention, delivered when he was merely a candidate for the Senate, changed that.
Overnight he became a sought-after surrogate campaigner, and he had scarcely settled into his Senate seat when he began preparing for his run for the White House.
A survey of voters leaving polling places on Tuesday showed the economy was by far the top Election Day issue. Six in 10 voters said so, and none of the other top issues-energy, Iraq, terrorism and health care-was picked by more than one in 10.
"May God bless whoever wins tonight," President Bush told dinner guests at the White House, where his tenure runs out on Jan. 20.
The Democratic leaders of Congress celebrated in Washington.
"It is not a mandate for a party or ideology but a mandate for change," said Senate Majority leader Harry reid of Nevada.
Said Speaker Nancy Pelosi of California, "Tonight the American people have called for a new direction. They have called for change in America."