"I have nothing but respect, love and admiration for the great nation of Iran and its warm-hearted, generous and brave people," Dr Moore-Gilbert said.
"It is with bittersweet feelings that I depart your country, despite the injustices which I have been subjected to.
"I came to Iran as a friend and with friendly intentions, and depart Iran with those sentiments not only still intact, but strengthened."
Dr Moore-Gilbert also thanked the Australian government for "working tirelessly these past two years and three months to secure my release" and everyone who had supported her from afar.
"Thank you also to all of you who have supported me and campaigned for my freedom, it has meant the world to me to have you behind me throughout what has been a long and traumatic ordeal."
She also asked for the media to respect her privacy during "what will undoubtedly be a challenging period of adjustment".
Iranian broadcaster's Iribnews website showed video footage of three unidentified men - one of them in a wheelchair - draped in Iranian flags and being met by officials.
It also aired images of a veiled Dr Moore-Gilbert entering a building with the Australian ambassador to Tehran, Lyndall Sachs, before taking off her face mask. She is later seen getting into white van carrying a brown bag.
The broadcaster provided no further information on the prisoner swap.
Prime Minister Scott Morrison has refused to offer details on whether the Iranian prisoners involved in the swap were from Australia.
"I don't go into any of these arrangements," he said on Thursday morning.
Diplomatic sources earlier confirmed Saeed Moradi, Mohammad Khazaei and Masoud Sedaghat Zadeh, three terrorists held in Thailand for attacking Israeli diplomats, were released by Thai authorities as part of the deal, media reports suggested.
But Mr Morrison said if people have been released in other places, "they are the decisions of the sovereign governments."
"There are no people who have been held in Australia who have been released," he added.
A lecturer in Islamic Studies at the University of Melbourne, Dr Moore-Gilbert's arrest was confirmed by Iran in September 2019 but it is believed she had been detained a year earlier.
She has denied the charges against her.
Iranian media has remained silent about Dr Moore-Gilbert and the little information that has emerged has mostly come from Australian authorities, her family and from British and Australian media.
British newspaper The Guardian reported that Dr Moore-Gilbert was arrested at Tehran airport by the Islamic Revolutionary Guard Corps in September 2018 after attending an academic conference in the holy city of Qom, in central Iran.
According to letters she smuggled out of prison and published in British media in January, Dr Moore-Gilbert rejected Tehran's offer to work as a spy.
Dr Moore-Gilbert wrote that the first 10 months she spent in an isolated guards-run wing of Tehran's Evin prison had "gravely damaged" her mental health, according to extracts in The Guardian and The Times newspapers.
"Please accept this letter as an official and definitive rejection of your offer to me to work with the intelligence branch of the Iranian Revolutionary Guard Corps," she wrote, according to The Guardian.
"I am not a spy. I have never been a spy and I have no interest to work for a spying organisation in any country.
"When I leave Iran, I want to be a free woman and live a free life, not under the shadow of extortion and threats," she added.
She claimed she was shown two different decisions to her appeal – one for a 13-month sentence, another confirming the original sentence of 10 years.
"I am still denied phone calls and visitations, and I am afraid that my mental and emotional state may further deteriorate if I remain in this extremely restrictive detention ward," she wrote.
Source: The Modern Middle East/AAP
In October, friends said Dr Moore-Gilbert had been returned to Tehran's notorious Evin prison, prompting fresh concern about her well-being.
She had disappeared inside Iran's prison system a week earlier, sparking frantic efforts to learn her whereabouts.
Conditions at Evin are believed to be marginally better than Dr Moore-Gilbert's previous jail at Qarchak - a women's facility that has been blacklisted under UN human rights sanctions and is notorious for the ill-treatment of political prisoners.
Throughout Dr Moore-Gilbert's internment, friends and family had become increasingly critical of what they said was Australia's ineffective diplomatic approach.
Iran, which has tense relations with the West, has over the years arrested several foreign nationals most often on accusations of spying.
They include French-Iranian academic Fariba Adelkhah, who was detained in the Islamic republic in June 2019.
Two other Australians, travel bloggers Jolie King and Mark Firkin, were released in October 2019 by Iran, in another apparent swap for Iranian student Reza Dehbashi.
With reporting by Caroline Riches
Readers seeking support can contact Lifeline crisis support on 13 11 14, Suicide Call Back Service on 1300 659 467 and Kids Helpline on 1800 55 1800 (for young people aged 5 to 25). More information is available at Beyond Blue.org.au and lifeline.org.au.