Ahmadinejad said military forces in Iran were "invincible" given their religious devotion, Iran's state-funded broadcaster Press TV reports.
Ahmadinejad said security in the Persian Gulf is a national priority that should be coordinated with regional allies.
"Security will be established through the participation of the nations and governments of the region and foreign interventions will bring about nothing but destruction, dispute and insecurity," he was quoted as saying.
Security is tight in the region following threats by Iran to choke off key oil-shipping lanes in the Persian Gulf in response to economic sanctions imposed by the U.S. and European governments.
Iranian army commander Maj. Gen. Ataollah Salehi said the presence of foreign military forces in the Persian Gulf "is not very important to us from a military point of view." He didn't name any particular country.
Iran had military parades Tuesday in Tehran to mark National Army Day.