Stena Impero, a British-flagged vessel owned by Stena Bulk. (Reuters)

Iran will free seven crew members of the detained British-flagged tanker Stena Impero, Iranian state television reported on Wednesday.

Foreign Ministry spokesman Abbas Mousavi told the TV that the seven, who include Indian citizens, were allowed to leave the tanker on humanitarian grounds and could leave Iran soon.

"We have no problem with the crew and the captain and the issue is violations that the vessel committed," Mousavi said.

The Swedish-owned Stena Impero was detained by Iran's Revolutionary Guards on July 19 in the Strait of Hormuz waterway for alleged marine violations, two weeks after Britain detained an Iranian tanker off the territory of Gibraltar. That ship was released in August.

The seizure of the Iranian tanker exacerbated tensions between Tehran and the West since the United States last year pulled out of an international agreement curbing Iran's nuclear program and reimposed economic sanctions.