A racing yacht carrying five British crew members was stopped in Iranian waters Wednesday and its crew taken to Iran, the British government confirmed.

"On 25 November, a racing yacht owned by Sail Bahrain and crewed by five British nationals, was stopped by Iranian naval vessels," reads a statement from Britain's Foreign Office.

"The yacht was on its way from Bahrain to Dubai and may have strayed inadvertently into Iranian waters. The five crew members are still in Iran."

British Foreign Secretary David Miliband said U.K. officials have been in touch with Tehran and are trying to resolve the matter swiftly.

"Our Ambassador in Tehran has raised the issue with the Iranian Foreign Ministry and we have discussed the matter with the Iranian Embassy in London," Miliband said.

The Foreign Office statement added that all the crew members aboard the yacht are "safe and well" and their families were informed before the information went public.

Sail Bahrain's Web site identified the yacht as the "Kingdom of Bahrain" and said it had been due to join the Dubai-Muscat Offshore Sailing Race, which was to begin Nov. 26.

The event was to be the boat's first offshore race, the Web site said, adding that the vessel had been fitted with a satellite tracker.

Richard Schofield, an expert on international boundaries in the Middle East at King's College in London, said it was difficult to understand how the boat could have ended up in trouble with Iranian authorities.

"It's hard to see why, on a regular journey from Bahrain to Dubai, they would have gone through Iranian territorial waters," he said.

Iran's elite Revolutionary Guard has the responsibility for protecting Iranian waters in the Persian Gulf. Officials from the Guard and from the regular navy could not be reached for comment on Monday.

Iran is holding three young Americans who strayed across the border from northern Iraq in July. The U.S. has appealed for their release, saying they were innocent hikers who accidentally crossed into Iran. Tehran has accused them of spying, a sign that they could be put on trial.

Fifteen British military personnel were detained in the Gulf by Iran under disputed circumstances in March 2007. Iran charged them with trespassing in its waters, and the Iranian government televised apologies by some of the captured crew.

All were eventually freed without an apology from Britain, which steadfastly insisted the crew members were taken in Iraqi waters, where they were authorized to be.

Click here for more on this story from Sky News.

The Associated Press contributed to this report.