The Pentagon says two U.S. coastal patrol boats were confronted by Iranian patrol boats in the Persian Gulf Wednesday, and one U.S. vessel fired warning shots into the water in response.

Pentagon spokesman Peter Cook said the U.S. crews acted appropriately to de-escalate the situation by firing three warning shots into the water, after the Iranian Revolutionary Guard Corps boats ignored flares and other attempts to establish contact with them.

"These steps are taken in order to make sure that our crew and our ship are able to protect themselves and prevent this from escalating into a more serious situation," said Cook, who said after the shots were fired the Iranian boats backed off.

The U.S. Navy vessels were identified at the USS Squall and USS Tempest, and Cook said Squall fired the warning shots. Cook said the destroyer USS Stout was also involved, but it wasn't immediately clear in what capacity.

The incident came a day after four Iranian patrol boats came within 300 yards of the destroyer USS Nitze in what the U.S. Navy described as an unprofessional high-speed intercept near the Strait of Hormuz.

In both cases, the U.S. vessels attempted to contact the Iranians by radio and got no response. Nitze sounded its horn and fire flares into the air.

It's the latest in a series of confrontations that the U.S. says are "extremely unprofessional and unnecessarily provocative," as well as in violation of recognized maritime "rules of the road" as spelled out in the 1972 Convention on the International Regulations for Preventing Collisions at Sea.

In December, Iran's navy fired unguided rockets less than a mile from the aircraft carrier USS Harry S. Truman as it was passing through the Strait of Hormuz. In January, 10 American sailors were taken captive when their two riverine boats strayed into Iranian waters near Farsi Island in the Persian Gulf.

Also in January, the U.S. says Iran flew an unarmed drone over a U.S. warship, a move that a U.S. Navy official called "abnormal and unprofessional."

Cook said reporters would have to ask Iran why it is harassing U.S. ships, saying the confrontations serve no purpose but to raise tensions.