A victory for McCain would make him the oldest president to begin a first term in the White House, while a victory for Obama would give the US its first black president.
Other early projections showed Obama holding on to solidly Democratic states such as New Jersey, Massachusetts, Maryland, Connecticut, Maine, Washington DC, and his home state of Illinois.
McCain kept Oklahoma, Tennessee, Kentucky, Arkansas, Alabama and South Carolina for the Republicans, according to media projections.
According to media projections, McCain has also held on to Georgia, a state where Obama had campaigned heavily for a higher turnout of black voters.
Under the US political system, the president is elected not by direct popular vote but by capturing 270 out of 538 electoral votes distributed throughout the country in a state-by-state contest.
Exit polls released by US media shortly after the first polls closed in Indiana and Kentucky at 6pm (23:00 GMT) indicated that Americans favoured Obama over McCain and that the economy was the dominant issue when they made their decision at the ballot box.
Fifty-seven per cent of people surveyed by the Fox News channel thought the Democrat was more in touch with people like them than his Republican rival.
CNN television reported 62 per cent of voters had said that the economy was of most concern to them, followed by Iraq with 10 per cent. Three out of four voters told CBS that the US was on the wrong track under George Bush, the outgoing US president.
Voting ends over the next six hours in the other 48 states.
Obama has retained a lead in most nationwide opinion polls and has the advantage in most of the battleground states, which are expected to decide the election.
But John McCain, his Republican rival, has dismissed the opinion polls and promised an upset.
Obama cast his ballot at a school gymnasium in his home city of Chicago with his wife and daughter by his side, while McCain voted in his home state of Arizona.
"I'm an American. And I choose to fight. Don't give up hope. Be strong. Have courage. And fight," the Republican said during a stop in Colorado later in the day.
"I feel the momentum. I feel it, you feel it, and we're going to win this election.
In Indiana, Obama met campaign workers and made several phone calls to undecided voters, warning the race was going to be tight.
"The question is: 'who wants it more?'" he told about 30 union activists gathered in a campaign office.
Joe Biden, Obama's running-mate, cast his ballot alongside his 91-year-old mother and wife, Jill, in his hometown of Wilmington, Delaware.
Sarah Palin, the Republican vice-presidential candidate, voted in the small town of Wasilla, Alaska, where she began her political career as mayor.
A record number of citizens were expected to cast votes in Tuesday's poll.
In Missouri, which has voted for the presidential winner in every election since 1904 with just one exception, officials were seeing a massive voter response.
"We do have an unprecedented turnout," Laura Egerdal, communications director for Missouri's secretary of state, said.
"I think today we are easily going to set a record for the sheer number of voters turning out today."
Al Jazeera's Sarah Brown, reporting from Chicago, said: "There are some incredible scenes with lines of voters queueing around the block at some polling stations.
"At some places people started lining up at 5am and had to wait up to two hours to vote. As expected, Obama's hometown is doing him proud - of more than 30 voters polled informally all but one were for the Democratic candidate."
Jean Jensen, Virginia's secretary of state, said the turnout was "phenomenal", noting that up to 40 per cent of the state's registered voters had cast their ballots by 10am.
In Florida, Al Jazeera's Sebastian Walker said voter turnout was high.
"This is an important state, and people are aware of how tight it will be," he said.
"The elderly here have a close alignment with the Republican party and John McCain and, while he is trailing in numerous polls here, Florida is a vital state," he said.
"It is also a state where voting irregularities have been witnessed, and that is still fresh in the minds of many people here."
Polling was extended in two areas of North Carolina in order to accommodate people still queuing to vote.