Thailand has freed three Iranian men jailed over a 2012 bomb plot following the release of British-Australian academic Kylie Moore-Gilbert by Iran.
Iranian media say the releases are part of a swap for the lecturer, who was held on spying charges she denies.
Two Iranians had been deported, while a third was pardoned in August, Thai officials said. The botched bombing in Bangkok was apparently aimed at Israel.
Ms Moore-Gilbert said leaving Iran after two years was "bittersweet".
Australian Prime Minister Scott Morrison described her release as a miracle, saying she seemed in good spirits when he spoke to her.