Main article: United States Senate election in Illinois, 2004
County results of the 2004 U.S. Senate race in Illinois. Obama won the counties in blue.

In May 2002, Obama commissioned a poll to assess his prospects in a 2004 U.S. Senate race; he created a campaign committee, began raising funds, and lined up political media consultant David Axelrod by August 2002. Obama formally announced his candidacy in January 2003.[61]

Obama was an early opponent of the George W. Bush administration's 2003 invasion of Iraq.[62] On October 2, 2002, the day President Bush and Congress agreed on the joint resolution authorizing the Iraq War,[63] Obama addressed the first high-profile Chicago anti-Iraq War rally,[64] and spoke out against the war.[65] He addressed another anti-war rally in March 2003 and told the crowd that "it's not too late" to stop the war.[66]

Decisions by Republican incumbent Peter Fitzgerald and his Democratic predecessor Carol Moseley Braun to not participate in the election resulted in wide-open Democratic and Republican primary contests involving fifteen candidates.[67] In the March 2004 primary election, Obama won in an unexpected landslide—which overnight made him a rising star within the national Democratic Party, started speculation about a presidential future, and led to the reissue of his memoir, Dreams from My Father.[68] In July 2004, Obama delivered the keynote address at the 2004 Democratic National Convention,[69] seen by 9.1 million viewers. His speech was well received and elevated his status within the Democratic Party.[70]

Obama's expected opponent in the general election, Republican primary winner Jack Ryan, withdrew from the race in June 2004.[71] Six weeks later, Alan Keyes accepted the Republican nomination to replace Ryan.[72] In the November 2004 general election, Obama won with 70 percent of the vote.[73]