(CNN) -- With just 100 days until the election, Sens. John McCain and Barack Obama are accusing each other of shifting their positions when it comes to Iraq.
Sen. John McCain says Sen. Barack Obama lacks judgment on Iraq.
Obama accused McCain of altering his stance after the senator from Arizona said 16 months would be a "pretty good timetable" for troop withdrawal, and McCain said Obama was becoming more inline with his position -- a "conditions-based" plan for withdrawal.
In an interview with Newsweek, Obama was asked about what sort of U.S. troop presence he would keep in Iraq, now that he has talked with diplomatic and military leaders there.
Obama returned to the United States on Saturday after spending more than a week in the Middle East and Europe. Watch Obama talk about his trip abroad »
"I do think that's entirely conditions-based. It's hard to anticipate where we may be six months from now, or a year from now, or a year and a half from now," he said in the interview, which was published on Saturday.
Obama has been a strong advocate of a 16-month timetable for withdrawal, while McCain has maintained that conditions on the ground must dictate plans for withdrawal. Watch McCain criticize Obama on Iraq »
In a statement issued Saturday, McCain's campaign said they welcomed Obama's shift to an "entirely conditions-based" withdrawal from Iraq.
"Today Barack Obama finally abandoned his dangerous insistence on an unconditional withdrawal of U.S. combat troops from Iraq by making clear that for the foreseeable future, troop levels in Iraq will be 'entirely conditions based.' We welcome this latest shift in Senator Obama's position, but it is obvious that it was only a lack of experience and judgment that kept him from arriving at this position sooner," the campaign said.
"Now that Obama has finally met with General Petraeus, it appears that he has also come to the conclusion that troop levels in Iraq must be based on the conditions on the ground."
In an interview that aired Sunday, McCain accused Obama of basing his Iraq policy on the "political path that would have helped him get the nomination of his party."
"Now, look, Senator Obama doesn't understand. He doesn't understand what's at stake here, and he chose to take a political path that would have helped him get the nomination of his party," McCain said on ABC's "This Week."
"I took a path that I knew was unpopular because I knew we had to win in Iraq. And we are winning in Iraq."
McCain comments were a continuation of remarks he made in an interview taped Friday for CNN's "Late Edition."
"I question his judgment because he lacks experience and knowledge, and I questioned his judgment. ... Senator Obama just views this war as another political issue, [on] which he can change positions," he said.
Asked Friday what he would do if Iraqi Prime Minister Nuri al-Maliki insisted a withdrawal was needed, McCain said, "He won't ... I know him well."
"He said it's a pretty good timetable based on conditions on the ground. I think it's a pretty good timetable, as we should have our horizons on withdrawal," he said.
Obama and al-Maliki last week discussed a "general time horizon" for any American troop withdrawals from Iraq.
Obama said Saturday, "we are pleased to see that there has been some convergence around proposals that we've been making for a year and a half."
"The fact that John McCain now thinks that it's possible for us to execute a phased withdrawal -- I think that's a positive thing and if the administration believes that as well, then I will, I will be fully supportive," he said while in London, England.
Also this weekend, McCain blasted Obama for canceling a visit to an American military base in Germany on Thursday. Read more
A McCain ad that began airing Saturday chides Obama for making "time to go to the gym" instead of visiting with wounded troops.
A top aide to Obama said Friday that the campaign canceled a visit to an American military base in Germany the day before because the Pentagon expressed concerns that it would be viewed as a campaign trip.
The presumptive Democratic nominee had planned on visiting a U.S. military hospital in Landstuhl, Germany, housing American troops injured in Iraq.
In his interview with "This Week," McCain implied Obama skipped out on the visit because no cameras would be there.
"I know this, that those troops would have loved to have seen him," McCain said. "And I know of no Pentagon regulation that would have prevented him from going there -- without the media, and the press, and all of the associated people -- nothing that I know of would have kept him from visiting those wounded troops."
The Obama campaign responded Saturday by saying that the last thing Obama wanted "was to have injured soldiers get pulled into the back-and-forth of a political campaign."
"That's why we imagine Sen. McCain would be surprised that his campaign released this wildly inappropriate accusation that politicizes the issue," Obama spokesman Tommy Vietor said in a statement.