(CNN) Iranian President Hassan Rouhani appeared to signal Wednesday that his country might be willing to release a British-flagged oil tanker it seized—in return for the UK's release of a detained Iranian tanker.

In a speech during a weekly cabinet session, Rouhani said Iran did not want to have continued "tensions with some European countries."

"And if they are committed to international frameworks and abandon some actions, including what they did in Gibraltar, they will receive a proper response from Iran," he said during the session, according to the state-run Islamic Republic News Agency.

The UK and Gibraltar seized the Iran-flagged tanker Grace 1 in early July. UK authorities alleged the tanker was attempting to transport oil to Syria, a violation of EU sanctions.

Iran, in turn, seized the British-flagged Stena Impero last week, alleging that the ship had violated "international regulations."

Read More