's stance on the war is unambiguous: He voted for it, supports the current enhanced U.S. troop presence in Iraq and vigorously opposes any timetable to withdraw.
The public's stance on the war is as equivocal as McCain's is not: A strong majority of Americans oppose it and believe it was wrong in the first place, but more find McCain better suited to handle Iraq than his Democratic presidential rival,.
"He's more experienced militarily," said Ann Burkes, a registered Democrat and retired third-grade teacher from Broken Arrow, Okla. "And I don't know if I agree with stay-the-course (policy), but I think the good probably outweighs the bad with him, experience-wise."
Burkes illustrates the conflicted voter, one who is as likely to be influenced by McCain's policy positions as by his personal biography as a former Navy pilot who spent more than five years in a North Vietnamese prison.
For McCain, there is a major complication. Not all those voters who perceive him as stronger on Iraq say they will vote for him for president.
Unlike the 2004 presidential contest, this is not shaping up as a national security election. Neither the war nor terrorism is foremost in the public's mind. The economy and energy prices are the pre-eminent issues of the day. And on those, Obama has the edge.
Still, this hate-the-war, love-the-warrior strain runs through the American electorate. In a new Associated Press-Yahoo News poll, more than one out of five of the respondents who said they opposed the war also said they support McCain for president. The sentiment does not discriminate by gender or by age. Most significantly, it splits independent voters in favor of McCain.
Respondents said McCain would do a better job in Iraq than Obama by a margin of 39 percent to 33 percent. Undergirding that response is a strong sentiment that McCain would be a better leader of the military than Obama. One out of three respondents said that description matched McCain "very well," whereas only one out of 10 said the same of Obama, who did not serve in the armed forces.
The Iraq findings track McCain's advantage on the issue of terrorism. Of those surveyed, more than twice as many believe McCain can better handle terrorism than Obama. As such, McCain is emerging clearly as a candidate of national security, a conventional role for a Republican.
The public's views about Iraq are especially notable because many voters appear to separate McCain's past record of support for the war from their perception of his performance as a military leader. What's more, it points to a potential Obama vulnerability.
Only 6 percent of those who say they will vote for Obama say McCain would do a better job on Iraq. But among "weak" Obama supporters, that figure rises to 15 percent. Moreover, among undecided voters, McCain is preferred 25 percent to 15 percent over Obama on Iraq.
Leeann Ormsbee, a registered Democrat from Waterford, Pa., believes the United States rushed to war, but now does not believe troops should simply withdraw. The 29-year-old self-employed house cleaner says she has never voted for a Republican. She might this time.
"I do believe that he will do better in Iraq," she said of McCain. "Because he's served in the military and he has said we can't just pull out. ... I think we're just kind of stuck with it now and we have to finish."
Republican pollster Neil Newhouse calls these voters "nose-holders."
"They don't like the fact that we're over there, they don't think the decision was the right one, but they understand that if we simply withdraw our troops it would leave things worse off," he said.
Aware that national security is one of McCain's strongest features, Democrats and their allies have tried to portray his Iraq stance as a mere continuation of President Bush's policy. They have seized on his comments earlier this year when he speculated that U.S. troops could remain in Iraq for 100 years. Though he was talking about a presence of non-combat troops akin to those in South Korea, the remark has been used against him in television commercials.
Earlier this month, McCain kicked off his general election advertising campaign with an ad that featured his and his family's military service and his years in captivity but cast him as a man with a distaste for war.
"Only a fool or a fraud talks tough or romantically about war," he says in the ad.
McCain supported the resolution in 2002 that allowed Bush to use force in Iraq. He later criticized then-Secretary of Defense Donald H. Rumsfeld for his management of the war and went on to become one of the Senate's leading advocates of last year's buildup of troops. He has said he could envision troops withdrawing around 2013 but has refused to fix a date.
"We were losing in Iraq; now we're winning," he has said.
The troop expansion, which is about to end, has left Iraq safer and given Iraqi forces greater responsibility for security. But Pentagon and congressional reports issued this week also warned that the gains are delicate and could be reversed.
McCain's Iraq advantage could evaporate if violence and chaos resurface and U.S. casualties mount. Conversely, even greater successes in the country could make withdrawing troops more palatable.
Obama has argued that the troop buildup has not helped resolve Iraq's political problems. He wants to remove all combat brigades from Iraq within 16 months of becoming president. But he has said that if al Qaeda builds bases in Iraq, he would keep troops in the country or in the region to carry out "targeted strikes."
"As the American people get to know Obama and McCain better, they will see that the difference is Obama's desire to fundamentally change American policy in Iraq and John McCain wants to continue George Bush's policy," Obama spokesman Bill Burton said.
Democratic pollster Anna Greenberg said the evidence of improvements this year presents a double-edged sword for McCain and Obama.
"Obviously, people don't like the war in Iraq; they want it to be over and they don't like all the money we're spending there," she said. "On the other hand, people also don't want to retreat or lose. ... In 2006, (the public's view of the war) was much more clearly a net positive for Democrats. I think the landscape has changed."
At the Pew Research Center for the People & the Press, which has also polled on Iraq and the presidential candidates, associate director Michael Dimock said the public has a perception that McCain "is not completely on board with Bush."
What's more, he said, Obama faces lingering concerns about his experience, about not being tested and about not having foreign policy experience - themespushed during their prolonged primary contest.
"What you see is that Americans themselves are conflicted about Iraq," he added. "They are very hesitant to say that we need to get out now. They understand the complexity of this situation."
By Jim Kuhnhenn