Americans divide evenly between Barack Obama and John McCain's approaches to the war in Iraq, and rate McCain much more highly on his abilities as commander-in-chief — key reasons the unpopular war isn't working more to Obama's advantage.

Despite broad, longstanding dissatisfaction with the war, just 50 percent of Americans prefer Obama's plan to withdraw most U.S. forces within 16 months of taking office. Essentially as many, 49 percent, side with McCain's position — setting no timetable and letting events dictate when troops are withdrawn.

That division is reflected in another result: While Obama's steadily led on most domestic issues, he and McCain run about evenly in trust to handle Iraq, 45-47 percent in this new ABC News/Washington Post poll.

The war's been a top campaign issue, second only to the economy in public concern; Obama speaks on it Tuesday, after writing an op-ed on the subject in Monday's New York Times.

This poll also finds substantial concern on the troubled conflict in Afghanistan: Fifty-one percent of Americans now say the U.S. campaign against the Taliban and al Qaeda there has been unsuccessful, double what it was in the heady days of 2002.

Commander-in-Chief and Iraq

McCain's competitiveness on Iraq runs counter to broader views on the war, which more closely align with Obama's.

McCain supports the war and calls it essential in the U.S. campaign against terrorism; Obama differs. Among all Americans, 63 percent say the war was not worth fighting, steady the last year and a half. And six in 10 reject the idea that winning in Iraq is necessary for success against terrorism more broadly.

One reason McCain can push back on Iraq is his advantage as commander-in-chief — a striking one, albeit perhaps not surprising given his military background. Seventy-two percent of Americans — even most Democrats — say he'd be a good commander-in-chief of the military.

By contrast, fewer than half, 48 percent, say Obama would be a good commander-in-chief, a significant weakness on this measure. (McCain's rating is much improved from his unsuccessful campaign for the Republican presidential nomination in 2000, when 56 percent said he'd be a good commander-in-chief — no more than said so, at the time, about George W. Bush.)

The public's dissatisfaction with the war, furthermore, has not translated into a clear preference on what to do about it.

In previous ABC/Post polls there's been no significant demand for immediate withdrawal, given concern about what might follow — a result buttressed by the split in this survey even on whether or not to establish a timetable.

Views of progress in Iraq, also divided, are contributing as well.

Forty-six percent of Americans say the United States is making significant progress restoring civil order there — still fewer than half, but up 6 points from April to the most in two years. People who see progress (disproportionately Republicans) are much more apt to oppose a timetable for withdrawal and to prefer McCain in trust to handle the war in general.

In another result, about equal numbers say Obama and McCain have been clear in their positions on withdrawing from Iraq, 56 and 60 percent, respectively.

The Forgotten War in Afghanistan

This poll also finds very different views on the situation in Afghanistan, with notable concerns about the progress there. As noted, a bare majority of Americans, 51 percent, now say the U.S. military effort in Afghanistan has been unsuccessful, up from 24 percent in fall 2002. Just 44 percent see it as a success, down from 70 percent.

At the same time, 45 percent say the war in Afghanistan was not worth fighting — many fewer than say so about Iraq. And Afghanistan is more closely linked to terrorism: Just 42 percent say the war on terrorism can be a success without victory in Afghanistan, vs. the 60 percent who say so about Iraq.

Dividing Along Party Lines

Views of both wars divide clearly along partisan lines, with Democrats consistently holding more negative views, Republicans more positive ones. Independents, as so often is the case, tip the balance.

Majorities of Democrats and independents alike say the Iraq war was not worth fighting and that it's not linked to the broader war on terror; smaller majorities say there's been no significant progress there. Republicans take the opposite view on each of these.

On Afghanistan, however, independents side more closely with Republicans than with Democrats. Majorities of Republicans and independents think the war in Afghanistan was worth fighting and that the effort there is linked to the eventual defeat of terrorism more broadly. Majorities of Democrats disagree.

Similarly, 81 percent of Republicans oppose a timetable for withdrawal from Iraq while three-quarters of Democrats support one; independents divide, 53-47 percent

There's partisanship, as well, in views of Obama's readiness as commander-in-chief.

Sixty-nine percent of Democrats say he'd do well in this role; just 44 percent of independents and a mere 19 percent of Republicans agree. Majorities in all three groups, by contrast, say McCain would be a good commander-in-chief — 56 percent of Democrats, 74 percent of independents and a near-unanimous 94 percent of Republicans.

METHODOLOGY: This ABC News/Washington Post poll was conducted by telephone July 10-13, 2008, among a random national sample of 1,119 adults, including an oversample of African Americans (weighted to their correct share of the national population), for a total of 209 black respondents. The results from the full survey have a 3-point error margin. Sampling, data collection and tabulation by TNS of Horsham, PA.