By Jonathan Head
BBC News, Chiang Mai
I could tell the court officials did not want us there. Normally Thai courts are pretty relaxed places, where journalists are free to wander about and watch the proceedings. Not this time.
Swiss man Oliver Jufer faces up to 75 years in jail for defacing a poster
The officials were surly, and we were restricted to a few places.
We were given little information about the case of Oliver Jufer, a 57 year-old Swiss man. But then the charges he faced were unusual; he had been arrested in December after being caught defacing several posters with black paint.
His mistake was that the posters showed the face of King Bhumibol Adulyadej. Insulting or criticising the monarchy is strictly forbidden by law in Thailand. Mr Jufer faces up to 75 years' imprisonment.
We had heard he was indignant when first arrested. He had planned to plead not guilty. But he has clearly been advised since, perhaps by his lawyer, or the Swiss Embassy, to change his tune.
Today he changed his plea to guilty, and was led out of court looking shocked, his legs in chains, in a long line of Thai prisoners.
His best hope now is that the judge shows leniency, or that some kind of diplomatic, face-saving deal can be done that lets him leave the country.
Otherwise, his lawyer said, the minimum sentence the judge can pass is seven and a half years in jail.
Many Thais are in despair over their country, which is deeply divided over whether [Former Prime Minister] Thaksin or the military is the worst option
But this is not an issue the Thai authorities want discussed or debated.
When he was arrested they strongly discouraged the Thai newspapers from reporting the case. Only one did.
At one point during today's hearing the prosecutor came out and told us the case would be postponed, and heard later in closed session.
"We don't want the media," he said. "We don't want the Thai people to know about this. No good result can come from their knowing about cases concerning the king."
It was a lie. The case was not postponed. He just hoped it might persuade us to leave.
So why are the Thai authorities so nervous? And why deal so harshly with a man who was by all accounts drunk when he defaced the posters?
It is not as though they have to set an example. Almost the entire population of Thailand came out to celebrate the king's 60th anniversary on the throne last year, in a mass outpouring of affection and veneration I have seen nowhere else.
Nine months later you still see huge numbers of people wearing yellow, the king's colour, to work, to social events, even at home.
Some Thais fear for the future of their revered monarchy
The respect they feel for their monarch is genuine, and deeply-felt. Very few would wish to say anything unfavourable about the king, which is one reason why cases of Lese Majeste are quite rare. It would seem the law is not really needed.
Talk privately to well-educated Thais, though, and you hear different views. Most still admire the king for his dedication to duty, but they worry about the monarchy's future.
The king is 79 years old and in uncertain health. His son, the crown prince, does not enjoy the same affection that his father does, and many Thais feel he cannot fill his father's shoes. These concerns are well-known in Bangkok; less so in the countryside.
The problem is that the monarchy, although a largely symbolic institution under Thailand's various constitutions, has been elevated in people's minds to the status of a national saviour.
Politics has always been messy, and politicians are mostly viewed as corrupt and self-serving, doing little good for the country. Little effort is made to improve the political culture, because people feel they can rely on the untarnished status of the king to sort them out in times of trouble.
And times have rarely been as troubled as they are now. The crowds offering flowers to the soldiers who led last September's coup against Prime Minister Thaksin Shinawatra are just a faded memory.
The military-installed interim government grows less and less popular by the day as it struggles to chart a course back to democratic rule.
Many Thais are in despair over their country, which is deeply divided over whether Mr Thaksin or the military is the worst option.
At such a time no-one wants to think about the time when they will be without the only king most people have known in their lives.
So whatever their worries, there is no appetite to discuss the monarchy, nor to tinker with the law that inhibits such discussion. It's safer, they say, to leave the law, and leave people in no doubt that they cannot criticise the monarchy in any way, than to see Thailand's royals go the way of Britain's.
It's a perspective Oliver Jufer must wish he had kept in mind on that fateful night last December.