Democrat Barack Obama wrote his name forever into the pages of American history on Tuesday, engineering a social and political upheaval to become the country's first black president defeating his Republican rival John McCain. The 47-year-old Illinois senator will be sworn in as the 44th president of the United States on January 20 next year. Obama first appeared unstoppable as he swept a series of key battleground states early in the night with wins in Ohio, Pennsylvania and New Hampshire.