Iranian forces fired warning shots across the bridge of a Marshall Islands-flagged cargo vessel as it was traversing the Strait of Hormuz in Iranian territorial waters, boarded the ship and directed it toward the Iranian mainland, a Pentagon official said Tuesday.

The incident, which prompted the U.S. Navy to dispatch a destroyer and a plane in response, comes as Iran and the U.S. along with other world powers try to hammer out a final deal over Tehran's nuclear program.

The master of the cargo ship MV Maersk Tigris had initially refused an Iranian order to move further into Iranian waters, but after the warning shots were fired the vessel complied, said Col. Steve Warren, a Pentagon spokesman.

The cargo ship, which had more than 30 people aboard, was directed to waters near Larak Island, he said. The island sits off the major Iranian port of Bandar Abbas and is one of several in the Strait of Hormuz.

Iranian state television reported that only 24 crew were onboard the vessel, and hailed from Britain, Bulgaria, Romania and Myanmar. It said the ship was seized based on a court order due to unspecified violations. Iranian officials could not immediately be reached for comment.

Bandar Abbas is the main port for Iran's Navy and separate naval forces operated by the elite Revolutionary Guard, as well as the country's primary commercial port. It overlooks the Strait of Hormuz, the highly strategic waterway at the mouth of the Persian Gulf.

The strait is the route for about a fifth of the world's oil and is only about 33 kilometers (21 miles) wide at its narrowest point. Ships traversing the chokepoint have even less room to maneuver. The shipping lane in either direction is only two miles wide, with a two-mile buffer zone between them.

Iran has in the past threatened to block the strait, a move that could spark a military conflict in the Gulf. American and allied naval forces routinely patrol the strait and have conducted military drills aimed at countering threats such as sea mines that Iran might use to close the waterway.

Tehran frequently conducts military exercises of its own in and around the strait. Large-scale, live-fire naval drills in February saw Revolutionary Guard forces assault a replica of a U.S. aircraft carrier built in a Bandar Abbas shipyard.

"It is inappropriate" for the Iranians to have fired warning shots across the ship's bridge in Tuesday's circumstances, Warren said. He said it was too early to know whether the Iranian intervention amounted to a violation of the freedom of navigation through a waterway heavily used by international shipping.

Warren said the cargo ship had been boarded by Iranians, but no one was injured and no Americans were involved. The spokesman said the U.S. government has "certain obligations" to defend the interests of the Marshall Islands, but he was uncertain how those obligations to the Pacific Ocean nation apply in this situation.

The Iranian vessels, numbering five or six, were with the Iranian Revolutionary Guard Corps Navy, he said. The incident began at about 4:05 a.m. U.S. Eastern Daylight Time, he said.

After the cargo ship sent a distre6ss call, the U.S. Navy sent the destroyer USS Farragut and a Navy maritime patrol and reconnaissance aircraft to the area of the incident to monitor the situation, according to Warren.

Lt. Joseph Hontz, a spokesman for the U.S. Navy's 5th Fleet in Bahrain, which oversees American maritime operations in the region, declined to comment further on the incident and referred queries to the Pentagon.

Maersk, based in Copenhagen, Denmark, said the ship was chartered to Rickmers Ship Management, based in Hamburg, Germany. Maersk said it had no information about the crew or the cargo. Sabina Pech, a Rickmers spokeswoman in Hamburg, said she was aware of the incident but had no information and could not comment.

In 2007, Revolutionary Guard forces captured 15 British sailors and marines from a frigate in the Gulf, accusing them of operating in Iranian waters. They were released less than two weeks later.

___

Burns reported from Washington. Associated Press writers Nasser Karimi in Tehran, Iran, Jan Olsen in Copenhagen, Denmark and David Rising in Berlin contributed to this report.

___

Follow Adam Schreck on Twitter at www.twitter.com/adamschreck.