The 2008 United States presidential election happened on November 4, 2008. During that day the President of the United States and Vice President of the United States were selected. Barack Obama from the Democratic Party defeated John McCain to win the presidency, and became the first African-American president. He was sworn in as President on January 20, 2009. In a United States presidential election, a person must get 270 electoral votes to win.