Democrat Barack Obama captured the White House on Tuesday after an extraordinary two-year campaign, defeating Republican John McCain to make history as the first black U.S. president.