McCain noted U.S. military officials recently discovered a cache of armor-piercing bombs in Iraq, and he hinted the explosives had been provided by Iran. U.S. officials have long been saying that Iran provides explosively formed penetrators, or EFPs to, Shiite militias in Iraq, although the Iranian government denies any role.
The U.S. military reported two such finds during the past week.
McCain also voiced concern that Tehran is bringing militants over the border into Iran for training before sending them back to fight U.S. troops in Iraq, and blamed Syria for allegedly continuing to "expedite" a flow of foreign fighters.
"We continue to be concerned about Iranian influence and assistance to Hezbollah as well as Iranian pursuit of nuclear weapons," McCain said.
He added that, if elected president, he would coordinate better with Europe to impose a "broad range of sanctions and punishments" on Tehran, to "convince them that their activities, particularly development of nuclear weapons, is not a beneficial goal to seek."
McCain declined to comment on whether he could back an eventual decision to strike Iran if Tehran doesn't cease its nuclear activities.
In response to a question about possible U.S. strikes against Tehran, McCain only said: "At the end of the day, we cannot afford having a nuclear armed Iran."
He warned that any hasty pullout from Iraq would be a mistake that would favor Iran and al Qaeda.
"We continue to be very concerned about the Iranian influence in Iraq and in the region," McCain said.
McCain ran into trouble last year when he joked about bombing Iran, giving a campaign audience in South Carolina a rendition of the opening lyrics of the Beach Boys rock classic "Barbara Ann," calling the tune "Bomb Iran" and changing the words to "bomb, bomb, bomb, bomb, anyway, ah ..."
McCain, who has linked his political future to U.S. success in Iraq, was in the wartorn country on Monday for meetings with Iraqi and U.S. diplomatic and military officials.
"We were very encouraged by the success of the surge and the reduction in U.S. casualties," McCain told reporters in Jordan, where he stopped on the next leg of a congressional visit that will also take him to Israel, Britain and France.
"We are succeeding, but we still have a long way to go," he warned. "Al Qaeda is on the run, they're not defeated."
A "major battle" remains to be fought to reclaim the northern Iraqi city of Mosul, he said, stating it was a success for the U.S. that Iraqi troops were now "taking the lead in that struggle" against al Qaeda.
Later Tuesday, McCain received a celebrity welcome in Jerusalem, beginning a two-day visit to Israel with a stop at the Yad Vashem Holocaust memorial. As his motorcade pulled up dozens of tourists greeted him and chanted "Mac is back," as he shook their hands and posed for photographs.
His visit to Iraq was the Arizona senator's first since emerging as the presumed Republican nominee. He was accompanied by Sen. Joe Lieberman of Connecticut, an independent, and Sen. Lindsey Graham, R-S.C., two of his top supporters in the race for president.
He promised that, if elected president, he would uphold a long-term military commitment in Iraq as long as al Qaeda in Iraq is not defeated.
McCain, who is the top Republican on the Senate Armed Services Committee, said the trip to the Middle East and Europe was for fact-finding purposes, not a campaign photo opportunity.
He is expected to meet with British Prime Minister Gordon Brown for the first time, and French President Nicolas Sarkozy for the third time. He met and corresponded with Sarkozy both before and after the French president was elected. They last saw each other last summer.
McCain has told U.S. reporters he worries that insurgents might try to influence the November presidential election by stepping up their attacks in Iraq.
McCain is a supporter of the 2003 invasion and President Bush's troop increase last year.