SAN DIEGO -- The Navy is investigating how two of its warships on Tuesday ended up on a collision course in a narrow channel of California's San Diego Bay.
The vessels came within 35 yards of each other on Tuesday morning, according to a Navy official, but were able to avert disaster through some last-minute maneuvering.
"USS Momsen and USS Harpers Ferry were transiting opposite directions in the San Diego Bay in close vicinity, Nov. 29. Both ships maneuvered to safety," U.S. 3rd Fleet spokesman Lt. Samuel Boyle told ABC News in a statement.
Neither was damaged and no sailors were hurt as a result of the evasive actions.
The incident occurred in a somewhat narrow part of the channel that requires constant turns, according to the Navy official. The commanders of both ships agreed in advance to traverse the channel simultaneously and pass by in opposite directions. But although the ships were in communication from the beginning, they ended up sailing head-on at each other.
A second Navy official confirmed the authenticity of a video posted on Twitter that shows the near miss, and includes audio of the two ships communicating to avoid collision.
In the video, transmission from the Momsen's bridge to Harpers Ferry can be heard: "We are coming to port to avoid you."
The word "port" is used here in the nautical sense, meaning the Momsen intended to veer left, as it can be seen doing in the video.
The Harpers Ferry responded in kind: "We are coming to port to avoid you as well."
The Harpers Ferry is a 610-foot-long amphibious ship that weights more than twice as much as the Momsen destroyer vessel, which is why it appears slower to turn in the video.
It was not a viable option for either ship to simply stop and let the other pass, because without propulsion they would be left at the mercy of the currents and wind, and would not be able to keep stable and on course, according to the first official. But while it is not uncommon for ships to pass by in opposite directions in the channel, they came closer than they should have in this case, the official added.
"We were watching it and ... the [surface warfare officers] around here were like, 'Phew, that was close!'" the second Navy official said. "But the consensus here is like, wow, they did a really good job of talking to one another and getting out of a tough situation."
The Navy is now working to find out how the two ships got into that tough situation in the first place, and who might have been responsible.
San Diego Bay is home to one of the largest Navy bases in the U.S., which serves as the main port for more than 50 ships and tens of thousands of personnel.
ABC News' Luis Martinez contributed to this report.