An Australian author jailed in Thailand for insulting the country's monarchy in a book has been granted a royal pardon.
Harry Nicolaides was arrested in August in Thailand over comments made in his book Verisimilitude which was a poor seller.
He was sentenced to three years in jail last month for insulting the Thai monarchy in the 2005 book.
The case was the latest in a slew of lese-majeste investigations in Thailand that rights groups say stifle freedom of speech and political dissent.
Lese-majeste, or insulting the monarchy, is a very serious offence in Thailand, where many people regard the 81-year-old king as semi-divine.
It is punishable by up to 15 years in prison although convictions, especially of foreigners, are rare and are normally followed quickly by a pardon.
His brother, Forde Nicolaides, says the author walked free from prison on Friday after Thailand's King Bhumibol Adulyadej issued a royal decree.
It ended a "six-month nightmare" for the family, after the author's arrest in August and subsequent conviction and jailing last month, Mr Nicolaides says.
Upon boarding the flight in Thailand Harry Nicolaides was told his mother Despina had been admitted to hospital after suffering a stroke.
"I am angry, I am frustrated, I am perplexed," Mr Nicolaides said when he arrived in Melbourne on Saturday.
With tears streaming down his face he hugged his partner, Jintana Suttanu, his father Socrates, brother Forde, and other family members.
His lawyer, Mark Dean, said the case had been processed with assistance from the Australian government "resulting in him receiving a royal pardon".
The author, 41, was sentenced in January by a Thai criminal court over Verisimilitude, which contained references to an unnamed crown prince.
He was arrested as he boarded a flight to Melbourne and was repeatedly denied bail.
Television images of a deeply distraught Nicolaides led to widespread concern in Australia, with his family shocked as he was brought to the court in chains.
He described his time in prison as "torture" and "a bad dream" and has expressed remorse over the publication.
Critics and freedom of speech advocates say the Thai government's crusade to protect the crown in the twilight years of King Bhumibol's six-decade reign is a pretext to crush political dissent and opposition.