According to Chinese state media, 28-year-old Yang Jia showed no emotion as the court rejected his appeal against the intermediate court's decision.
In the verdict, the court said he launched an attack on the Zhabei district police station in revenge for unanswered demands.
"Evidence shows that Yang Jia was of a sober mind during the whole process of the attack and is capable of taking criminal responsibility," presiding judge Xu Wei said.
Zhai Jian, Yang's lawyer tried to get a second forensic psychiatric assessment to prove the unemployed man was mentally insane at the time of the killings, but this was denied.
A well-known defense lawyer, Zhai reasoned that no one in his right mind would kill six human beings.
But the court refused this argument.
According to the story, Yang came to Shanghai on holiday in October 2007. On October 5, a policeman detained him for riding an unlicensed bicycle.
Yang told the court he was brought back to the police station, insulted during the intial questioning and beaten up.
"I had bruises on my arms and back," he said. But Yang denied the policemen had injured his genitals, as some rumors had alleged.
A 34-minute audio tape of the questioning was played for the court and no insults were heard. An audio expert claimed the tape had not been edited. There was no videotape of the interrogation.
After the incident, Yang was upset and wrote many letters of complaint to the station, demanding compensation. But nothing was resolved.
He even tried to sue the officers 10,000 RMB ($1,464) in compensation for psychological damage, but the claim was rejected by the local public security bureau.
Then on June 26, 2008, Yang returned to Shanghai and bought a facemask, gasoline, teargas, a knife and hammer.
Yang told the court he bought these items to make his way back into the station and admitted he was planning revenge.
On July 1, he stormed into the police station and videos show he set the station's gate on fire and stabbed four people on the first floor.
Yang said he was not regretful for the murders, although he could not remember most of what happened on July 1. "It all started from the unpleasant encounter at the station," he said.
He said those victims were not innocent, although they were not the officers he claimed insulted and beat him.
"But I did not conduct intentional homicide," he said.
During his first trial he had requested the policeman who initially interrogated him to testify, but this was denied by the court. No other police staff who handled Yang's case were brought in to testify either.
Now the ruling has been sent to the Supreme People's Court for ratification before his execution.
This story attracted a lot of attention in China. Some were horrified by the crime, others sympathetic to Yang in his fruitless attempt at some kind of justice.
Despite the verdict that was upheld twice, there are still many holes in this case. Why didn't the policeman who interrogated Yang testify? Why weren't more psychological tests conducted to ensure he was of sound mind when he commited the gruesome murders?
Nevertheless, Zhai, his lawyer, finds it strange that Yang is ready for his fate.
"He even told me he feels happier in jail and is not afraid of death," Zhai said.
It seems Yang's crime determined his fate even before the trials began. He seemed to know this and didn't want to say he was insane to get off the hook.
This case shows how authority has little sympathy for the underpriviledged, who realize that one wrong move can change their lives forever.