(CNN) -- Sen. John McCain's campaign lashed out at Sen. Barack Obama on Saturday for canceling a visit to an American military base in Germany on Thursday.
"The most solemn duty of a commander in chief is to fulfill his responsibility to the men and women who serve this country in uniform," retired Lt. Col. Joe Reypya, speaking on behalf of the McCain, said in a statement. "Barack Obama ... broke that commitment, instead flitting from one European capital to the next."
And in a McCain ad that began airing Saturday, Obama is chided for making "time to go to the gym" instead of visiting with wounded troops.
The ad is being televised in Colorado, Pennsylvania and the Washington area, according to The Associated Press. Watch the ad at Time.com
The incident is representative of the delicacy with which the Obama campaign has attempted to navigate the Illinois senator's entire journey abroad, at once staging elaborate photo-ops beamed back to the American media while at insisting that Obama's trip is not a political one by definition.
Obama arrived back in the United States on Saturday night.
The presumptive Democratic nominee had planned on visiting a U.S. military hospital in Landstuhl, Germany, housing American troops injured in Iraq. Watch more on the troop controversy »
The visit was expected to come after Obama's speech in Berlin, Germany, but the campaign suddenly announced Thursday that the stop had been canceled, saying Obama had determined that it would be "inappropriate."
"For a young man so apt at playing president, Barack Obama badly misjudged the important demands of the office he seeks," Reypya said in Saturday's statement. "Visits with world leaders and speeches to cheering Europeans shouldn't be a substitute for comforting injured American heroes," he added.
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.
McCain himself joined in the rebuke, the AP reported, saying in an interview to be aired Sunday by ABC's "This Week" that "if I had been told by the Pentagon that I couldn't visit those troops, and I was there and wanted to be there, I guarantee you, there would have been a seismic event."
Senior Obama adviser Robert Gibbs said Friday that retired Major Gen. Scott Gration, a policy adviser to the campaign, received a call from Pentagon officials earlier in the week expressing concerns about the trip -- specifically because Obama was heading there on his campaign plane and campaign staff members would be accompanying him on the visit.
After speaking with Gration, the campaign decided to cancel the trip. Gibbs said Obama is "comfortable with the decision" because he did not want to make the troops part of a campaign event. Watch more on Obama's trip to Germany »
But the decision to cancel the event quickly drew widespread criticism from conservative blogs and McCain's campaign.
"Barack Obama is wrong," McCain spokesman Brian Rogers said in a statement Friday. "It is never 'inappropriate' to visit our men and women in the military.''
Pentagon spokesman Bryan Whitman said later Friday that the Pentagon did not explicitly say Obama should not visit the base but was concerned with whether his capacity there would be one of a presidential candidate, not a senator.
"We do have certain policy guidelines for political campaigns and elections. And what is appropriate and what is not appropriate in those situations. But the Pentagon certainly did not tell the senator that he could not visit Landstuhl," Whitman said.
"Generally speaking, the military tries very hard not to get involved in political campaigns," he said. "Conducting a campaign speech for example on a military installation is not something that would be appropriate to do."
In another sign that the Obama campaign has had difficulty maintaining the notion the presidential candidate's trip is devoid of politics, it also received criticism Thursday night for distributing an e-mail to supporters that highlighted Obama's Berlin speech and included a link for online donations.
The campaign insists that it was not a fundraising e-mail.
CNN's Ed Hornick and Sasha Johnson contributed to this report.