Donald Trump Donald John TrumpBubba Wallace to be driver of Michael Jordan, Denny Hamlin NASCAR team Graham: GOP will confirm Trump's Supreme Court nominee before the election Southwest Airlines, unions call for six-month extension of government aid MORE warned that he would order the Navy to open fire on Iranian boats that provoke American ships, days after a high-seas incident that ended peacefully.

When the GOP presidential nominee laid out his plan to modernize the military during a Friday night rally in Pensacola, Fla., he took an off-script aside to address his posture toward Iran.

ADVERTISEMENT

"With Iran, when they circle our beautiful destroyers with their little boats and they make gestures at our people that they shouldn't be allowed to make, they will be shot out of the water," Trump said to loud cheers.

Rally-goers could be heard shouting "shoot them" as Trump wound up.

This week, the Pentagon said seven Iranian attack boats harassed an American destroyer in the Persian Gulf.

Trump has taken a tough posture on Iran from the beginning of his campaign, slamming the Iran deal as a failure and blasting America's response to a January incident when Iran briefly detained American sailors who accidentally crossed into Iranian waters.

But he wouldn't go as far when discussing another international incident where a Russian fighter flew at a U.S. surveillance airplane.

"Putin laughs, believe me, he laughs at our leaders and takes us to the cleaners again and again," he said. "Yesterday, we had a plane, he had jets circling the plane. They were as close as 10 feet away — taunting us, toying with us — just like Iran."

Trump said earlier in the speech he would try to work with the Russians on fighting terrorism and batted down criticism of too-friendly relation between him and Vladimir Putin.