Washington (CNN) Two Iranian fast attack boats came within 300 yards of USS Essex in the Persian Gulf Friday while the four star head of the US Central Command was on board, according to two US defense officials.

General Joseph Votel, commanding general of CENTCOM, was observing routine flight operations on board the Essex when the incident happened.

The encounter with the two Iranian boats was ruled to be "safe and professional" by the Navy because the Iranians did not demonstrate hostile intent, the officials said.

There was no indication the Iranian boat crews were aware of Votel's presence. One of the officials said the two Iranian craft began shadowing the Essex and then started sailing in parallel with the US ship.

At one point, one of the Iranian boats crossed in front of the Essex about 300 yards away from the US ship.

Read More