Lin Senhao was executed after Shanghai No.2 Intermediate People's Court, acting on the execution order signed by the Supreme People's Court (SPC) president passed the order.
He was put to death after failing in a series of appeals, and met members of his family before being executed, state-run Xinhua news agency reported.
He was convicted of using N-Nitrosodimethylamine, a deadly chemical compound taken from a university lab, to poison his roommate, Huang Yang, which resulted in Huang's death.
Lin had a grudge against Huang and decided to inflict harm through poisoning, according to the SPC statement.
More From This Section
On March 31, 2013, Lin borrowed the key to an imaging lab at Fudan University-affiliated Zhongshan Hospital and picked up the chemical and a syringe, the SPC said.
Later that day, Lin brought the lethal chemical back to his student dorm room and poured them into the water dispenser.
On April 1, Huang vomited after drinking from the dispenser and went to Zhongshan Hospital for treatment where he admitted to the intensive care unit due to his worsening condition.
Huang died on April 16 of acute liver failure due to N-Nitrosodimethylamine poisoning followed by multiple organ failure, according to forensic analysis.