The British-flagged Stena Impero tanker sailed out of Iranian waters on Friday, the owner said, after it was detained in July during a row with Britain that has stoked tensions in the Gulf.