Russian opposition leader Alexei Navalny entered the courtroom on Thursday to hear the verdict in his embezzlement trial in an apparently buoyant mood.
He jokingly asked: "Why is everyone looking so serious?"
But three-and-a-half hours later, the judge delivered a heavy blow that appeared to rattle the composure of a man who has shown no fear of exposing alleged corruption around President Vladimir Putin.
Judge Sergei Blinov ordered a five-year prison sentence for the 37-year-old lawyer Navalny who then only had seconds to say his final goodbyes before court bailiffs moved in to arrest him.
Navalny just had time to hug his wife and tearful mother and shake hands with his father before being handcuffed and led away.
His co-defendant Pyotr Ofitserov, who received the slightly milder punishment of four years in prison, embraced his wife for as long as possible before they had to part.
After arriving in Kirov a free man on Thursday morning on the night train from the capital Moscow, Navalny was starting to serve his sentence in one of the city's two detention centres.
Well aware of what his sentence was likely to be, he reportedly had not bought a return railway ticket back.
Navalny, a lawyer who studied at Yale and seemed equally at home leading chants of "Putin is a thief" at rallies and cross-examining witnesses at his trial, was charged with organising embezzlement while acting as an unpaid advisor to the governor of the Kirov region in 2009.
Since Putin's return to the Kremlin last May, the authorities have raked over Navalny's past and opened so many probes against him that he says he has lost count. The Kirov case is just the first to go to trial.
The historic iron-porched courthouse in the low-rise city of Kirov, 900 kilometres (560 miles) north of Moscow, was an unlikely setting for an extraordinary trial that saw more than 100 journalists arriving from 4:00 am to secure a spot.
Dressed in a checked shirt and jeans, Navalny had earlier tweeted irreverently as the judge read out the conviction in an almost inaudible rapid monotone.
Navalny even complained on Twitter that he had a problem: his phone battery was about to die. He also gleefully suggested that the court should start a Mexican wave.
Sitting beside lawyers, Navalny directed warm glances at his wife Yulia, who wore plastic wristbands saying "Team Navalny" and "For Navalny".
There were no mitigating circumstances, said the judge, announcing a sentence of five years in a prison camp, a year less than sought by prosecutors.
Usually so ready with a catchy soundbite, Navalny did not say a word to journalists as he was led away.
"May God have mercy on You," read the slogan on a picture of Putin that Navalny tweeted before handing over his telephone to his wife.
Navalny, who has a daughter aged 12 and a son aged 5, could stay in prison until 2018, the same year when Putin could stand for a fourth term in the next presidential elections.
Outside, angry supporters chanted "Down with the police state" and tried to break through a cordon as a police van drove away carrying Navalny and his co-defendant Ofitserov, the head of a small timber firm.
Later, Navalny's wife, who is widely expected to take a much bigger public role after her husband's conviction, emerged on the court porch, with tears in her eyes but perfectly controlled as she called for supporters to carry on the fight.
"We will win. Please believe too that everything will be great."