Washington (CNN) President Donald Trump tweeted Wednesday that he has instructed the US Navy to "shoot down and destroy any and all Iranian gunboats" that harass US ships.

"I have instructed the United States Navy to shoot down and destroy any and all Iranian gunboats if they harass our ships at sea," Trump wrote

Later on Wednesday senior Pentagon officials said the tweet was a lawful order though it did not mark a change in the rules of engagement.

"The President issued an important warning to the Iranians. What he was emphasizing is all of our ships retain the right of self-defense and people need to be very careful in their interactions to understand the inherent right of self-defense," Deputy Defense Secretary David Norquist told reporters at the Pentagon.

Gen. John Hyten, Vice Chairman of the Joint Chiefs of Staff said the military will "apply that clear direction from the commander in chief into lawful orders" adding that is clear to Iran that there is a line they cannot cross that would provoke a response.