Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

WASHINGTON — The U.S. Navy and Iran are disputing whether an encounter Friday in the Persian Gulf between their naval vessels was safe or — as Iran's state news agency described it — an "unprofessional" confrontation.

The U.S. Navy said Saturday that a naval helicopter noticed a group of Islamic Revolutionary Guard ships heading toward the USS Nimitz's strike group "at a high rate of speed." A carrier strike group typically consists of five to seven ships that deploy together. In this case, the aircraft carrier Nimitz was the lead ship.

"U.S. naval forces attempted to establish communications, with no response from the Iranian vessels," the U.S. Navy said in a statement. "Shortly thereafter, at a safe distance, the U.S. helicopter deployed flares, after which the Iranian vessels halted their approach."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

An Iranian vessel steers close to the U.S. Navy coastal patrol craft USS Thunderbolt (R) in the Gulf in a still image from video provided by the U.S. Navy July 25, 2017. U.S. Navy / via Reuters

After the two parties communicated, the Iranian ships conducted a gun exercise.

U.S. Naval Forces Central Command said Saturday that the interaction was "safe and professional."

But the Iran state-sponsored IRNA news agency claimed that the U.S. ships acted as the provocateur as they came close to an Iranian oil offshore platform. They said that sending the chopper toward the Iranian ships was "unprofessional" and was ignored by the Islamic Revolutionary Guard.

A U.S. defense official told NBC News that three Iranian boats were involved and at least one of them had sped toward the USS Princeton, which was part of the Nimitz's carrier strike group.

The official added that the Iranian boats only stopped after the U.S. naval helicopter fired its flares. The Iranian ships then started firing rounds into the water, away from the U.S. ships.

The Iranian's decision to fire into the water is perfectly legal, the defense official added.

This is the second incident this week in which a U.S. ship has had a run-in with an Iranian vessel. A U.S. Navy patrol boat on Tuesday fired two warning shots toward an Iranian craft that U.S. sailors say came too close for comfort.

Courtney Kube reported from Washington, and Phil McCausland reported from New York.