By Michael Bristow
BBC News, Beijing
Chinese campaigner Hu Jia could have been given five or more years for "subverting the state" - in the end he was sent to jail for less.
Mr Hu's wife said he had been subjected to "endless questions"
But his lawyer, Li Fangping, was not happy.
"Although he's only been sentenced to three-and-a-half years, I still cannot accept this judgement," he told reporters outside the Beijing courthouse.
Before he heard the verdict, Mr Li was even blunter. "As a lawyer, I think Hu Jia is innocent and should be released."
Hu Jia was sent to prison for what many other people would not even consider a crime - he was convicted for writing five articles and giving two interviews.
The 34-year-old has long sought to publicise what he believes are injustices in China, concerning the environment, HIV/Aids and human rights.
Beijing's First Intermediate People's Court interpreted these acts as an attempt to subvert "the state's political and socialist systems".
Human rights organisations see it differently - they believe the Chinese authorities put the campaigner in prison to silence him ahead of the Olympic Games.
Hu Jia has become perhaps China's most prominent activist, and journalists from all over the world waited outside the court to hear his sentence.
Reporters were not allowed inside the court to hear it read out for themselves.
Several other campaigners, mostly people trying to highlight their own particular grievances, had also gathered outside the court to protest.
Petitioners gathered at the court to push their causes
One woman wanted justice for her son, claiming he had been beaten to death.
But most people had come to hear the judgement for Mr Hu.
About half an hour after entering the court to hear the sentence, his lawyer Mr Li came out to tell journalists what it was.
As well as being sent to prison, Mr Hu was deprived of political rights for one year.
The lawyer said his client and his family would decide later whether or not to appeal. Under Chinese law, they have 10 days to make up their minds.
A little later, Hu Jia's wife, Zeng Jinyan, also emerged from the court after attending the hearing with other family members.
Holding back tears, she said she had not been allowed to see her husband.
She added that her husband had a liver complaint, which had been exacerbated by his time in detention.
"There were tiring, endless questions without sleep," she said.
"When I saw him last, the most important thing I said to him was 'take good care of your health'."
Ms Zeng, who herself is a well-known rights campaigner, added that her husband showed little emotion when the sentence was announced.
In an article published by Xinhua, China's state-run news agency, the authorities laid out their case against Mr Hu.
Mr Hu's jailing has caused an international outcry
The article said Mr Hu wrote articles criticising the Chinese political system, and accepted interviews from foreign journalists.
"Hu spread malicious rumours, libel and instigation in an attempt to subvert the state's political and socialist systems," it said.
The Xinhua article also claimed Mr Hu had been given a lenient sentence because he had confessed to his crimes.
But Nicholas Bequelin, of US-based Human Rights Watch, said Mr Hu's arrest, conviction and sentence was politically motivated.
"The jailing of China's leading human rights activist reflects a further hardening of Beijing's stance towards dissent in the lead up to the Games," he said.
He also criticised the International Olympic Committee, which is currently meeting in Beijing, for not speaking out about the human rights situation in China.