The Criminal Court has acquitted computer programmer Surapak Phuchaisaeng of a charge of lese majeste, ruling that the prosecution had failed to prove its case.
Mr Surapak, 41, of Bung Kan, was accused of posting defamatory messages on a Facebook social media page.
He was arrested on Sept 2 last year and his laptop computer seized. He had been denied bail since his detention.
The Criminal Court delivered judgement on Wednesday morning. It said the prosecution had failed to prove its assertion that the defendant's computer was used to post on the web comments offensive to the monarchy.
Instead, defence witnesses including the defendant himself showed to the court that the temporary files found in the cache that the police and prosecutor presented as evidence could have been copied from another computer and posted into the laptop.
A defence witness from the Royal Naval Academy's engineering department had demonstrated to the court that using Facebook would not leave such a cache file because the Facebook system was designed to protect the security and privacy of users.
The court was convinced that the HTML files were not cached when browsing Facebook but were pasted into Mr Surapak's computer.
On the issue of credibility of evidence, the court said the defendant's laptop, which was presented in evidence, was opened on the nights of Sept 2 and 7, 2011, before the police computer forensic specialist received it for verification of evidence on Sept 7.
The court said it gave the defendant the benefit of the doubt. There was no credible proof that he sent the remarks referred to in the charges.
After his acquittal, a smiling Mr Surapak was hugged by his lawyer and his mother who had travelled to Bangkok from her Northeast home province for the ruling.
Surrounding by his supporters and friends, Mr Surapak said he was very glad to hear the verdict.
Asked if he would file a counter lawsuit against the people who framed him, he said he would think about it first.
His mother Taem Phuchasaeng, 68, said she was proud with her son all along, as she believed that he was a good person.
"It has been a painful year for me, travelling to visit him at the Bangkok Remand Prison. It is good that he fought (the lawsuit) and won it.
"It is a pity that certain other lese majeste defendants were not in a position to defend themselves. I was quite sorry, in particular, about the death of Ah Kong," said Mrs Taem.
She was referring to Ampon Tangnoppakul who died in the prison hospital in May this year while awaiting the formal procedure of dropping his appeal and proceeding a request for a royal pardon.
Panitan Prueksakaemsuk, the son of another lese majeste defendant, Somyos Prueksakasemsuk, was among those who attended Wednesday's court session. He said Mr Surapak's victory might be a good example and comfort to other lese majeste defendants.
At least there were ways open to defend a case in court, Mr Panitan said. He thought there might be a different legal defence open in his father's case.
"We just hope for a political solution for other lese majeste prisoners," said Mr Panitan, a Thammasat University law student.