By Jon Leyne
BBC Tehran Correspondent
The crew were intending to participate in the Dubai-Muscat yacht race
Iran's coastal waters are patrolled rigorously by the Revolutionary Guards.
Anyone straying too close is almost certain to be arrested, as the five British yachtsmen released on Wednesday found when they were taken into Iranian custody a week ago.
Filming off the Iranian island of Qeshm two years ago, I was soon stopped and questioned, despite the fact that an Iranian government minder was already with me and I had all the relevant permissions.
The Iranian security officials simply could not believe I was making a report on the environment. They were convinced a British journalist in this sensitive area must be up to no good.
Since then, relations have become even worse, as Iran blames Britain for the turmoil that has followed President Mahmoud Ahmadinejad's disputed re-election in June.
So it was almost inevitable that when four British yachtsmen and a journalist strayed into Iranian waters, they would be questioned thoroughly.
At the best of times, the Iranian government suspects the outside world is preoccupied with trying to undermine it.
That obsession has come close to paranoia, as Iran takes on the West over its nuclear programme.
Within the Iranian government, there is also likely to have been some discussion over whether the captured British yachtsmen could be exploited for propaganda purposes, as a group of Royal Navy sailors and Marines was when they were held two years ago. Iran must have decided not.
During a lengthy television appearance on Tuesday night, President Ahmadinejad did not mention the British sailors. Instead he focused on Iran's nuclear programme.
President Ahmadinejad did not mention the sailors in his television address
That enabled this problem to be solved by some old fashioned diplomacy, as both Britain and Iran detached the issue of the sailors from their deeper political differences.
But at times that outcome had seemed in doubt.
One particular comment on Tuesday rang alarm bells, when Iran warned of possible serious consequences if the sailors had entered Iranian waters with "evil intentions".
Those words came from Esfandiar Rahim-Mashaie, one of Mr Ahmadinejad's closest aides and a man sometimes described as his ideological mentor.
This morning, just as the sailors were being released, one hardline Iranian paper talked darkly of the "suspicious sailing of British people in the Persian Gulf".
That is just the sort of whispering campaign that can spell trouble in Iran.
In the end perhaps the evidence was simply too overwhelming that these British sailors had been doing what they always insisted, innocently taking a racing yacht to Dubai.
But with this mini-crisis over, there are plenty more issues to strain Iranian-British relations.
Mr Ahmadinejad's government continues to confront the opposition, who believe he stole the election.
Reports have emerged that a leading economist and opposition figure, Saeed Leylaz, has been sentenced to nine years in prison.
And the storm clouds are gathering over Iran's nuclear programme, following the government's announcement of a huge expansion of its controversial capacity to enrich uranium.
Probably to reassure the faithful Iran is not going soft on Britain, a government-sponsored demonstration has been held outside the British embassy in Tehran - a small message to signify that Britain is still officially part of what Iran describes as the "global arrogance".