WASHINGTON -- Barack Obama got more than he bargained for from Iraqi Prime Minister Nouri al-Maliki barely after his military crash course in the Middle East's war zones began.

The freshman senator, making only his second trip to Iraq in two years, after a quick tutorial visit to Afghanistan (his first), got a well-timed campaign gift from Maliki, who embraced his plan to withdraw U.S. combat troops 16 months after taking office.

In an interview with the German magazine Der Spiegel, Maliki refused to take sides in the race, but, when asked about Obama's pullout timeline, he said, "Whoever is thinking about the shorter term is closer to reality."

It isn't new that Maliki supports a U.S. withdrawal of most combat forces from his country as Iraqi troops assume more responsibility for their own security. Negotiations have been continuing for some time about the future role of the United States in Iraq and when it will end.

Before Obama left for Kabul last week, the White House and Maliki hammered out a security agreement they called a "time horizon" for achieving "aspirational goals" for reducing U.S. combat forces there. It will most likely maintain the status quo for the time being, leaving that decision for the next president to negotiate.

Details of the delicate negotiations were not forthcoming. But Maliki told Der Spiegel, "The Americans have found it difficult to agree on a concrete timetable for the exit because it seems like an admission of defeat to them. But it isn't."

Still, support for withdrawal based on conditions on the ground in Iraq was not one-sided. Administration officials, including some commanders on the ground, have been talking about the increasing likelihood that more troops could be withdrawn by September if the security situation continues to improve.

But no sooner were Maliki's remarks released over the weekend than John McCain and the White House were rebutting any withdrawal by a fixed date that Obama, apparently, had pulled out of thin air without any thought to the circumstances the Iraqis might face two years from now.

Adm. Mike Mullen, chairman of the Pentagon's Joint Chiefs of Staff, said, "The consequences could be very dangerous."

But Mullen also made it clear that force reductions were very much in the cards because of the sharp reduction in violence in Iraq, the political progress between Shiites and Sunnis, and recent economic gains.

If those conditions continue to improve, Mullen said he "would look to be able to make recommendations to President Bush in the fall to continue those (U.S. troop) reductions."

Until this week, American voters were about evenly split over Obama's withdrawal plan, with 50 percent supporting his pullout timetable and 49 percent supporting McCain's position that "events should dictate when the troops are withdrawn," according to a recent ABC/Washington Post poll.

But Maliki has given Obama's 2010 timeline some additional credibility, forcing McCain on Monday to once again remind voters of his rival's poor judgment on Iraq since day one.

The reason security has dramatically improved in Iraq, giving rise to Maliki's call for a speedier U.S. withdrawal, is the military surge McCain pushed -- but that Obama opposed and flatly predicted would fail.

"This is the same strategy that he voted against, railed against. He was completely wrong about the surge. It is succeeding, and we are winning," McCain said.

At the same time, the Arizona Republican appeared to embrace the emerging consensus for withdrawal sometime within Obama's two-year framework. "I think they could be largely withdrawn" in that time, but added, "it has to be based on conditions on the ground."

McCain's strategy, which he has pursued since clinching the nomination, is to bore in on Obama's woeful inexperience in national-security policy. McCain has been to Iraq and Afghanistan many times, and has met and talked frequently with U.S. military leaders, including the U.S. commander in Iraq, Gen. David Petraeus, the architect of the surge. Until Monday, Obama had never talked with Petraeus one-on-one.

It is more than a little pathetic to hear nightly network news reporters talking about Obama's overseas trip in terms of his gaining needed national-security experience and foreign-policy credentials. As if a few days abroad can miraculously give anyone the experience to be commander in chief in a time of war.

The irony is that the much-improved situation Obama observed in Iraq and the lessons he learned in a few hours of briefings from Petraeus were the result of a war strategy the junior senator has repeatedly rejected and ridiculed throughout his campaign. Bush approved the surge, but it has McCain's name written all over it.

That strategy came out of numerous trips to the war zones, constant nagging to change a war policy that wasn't working, and a heroic lifetime of military service.

McCain's message this week, partially blunted by the withdrawal debate, is that Obama lacks the judgment and experience to think strategically in a time of war. One does not get that kind of experience in a quickie photo-op tour of the battlefield.