Six men have been sentenced to death in Bangladesh for the brutal beating and killing of two boys in two separate incidents earlier this year, which sparked protests over the violent deaths.

Samiul Islam Rajon, 13, died in July after he was brutally beaten by a group of men who filmed him screaming for help and posted the video online. The video lasted 28 minutes and the boy was seen tied to a pole and beaten with a metal bar while his attackers are heard laughing at him. The gang had accused him of stealing a rickshaw.

The father of Samiul Alam Rajon, a 13-year-old boy who was murdered in July, reacts on the court premises after the sentencing of his son's killers (AFP/Getty)

Thousands took to the streets to protest against Rajon’s killing, while a petition called for the government to give the perpetrators the “highest punishment possible”.

A month later 12-year-old Rakib Hawlader died after his former employer at a car repair shop used a nozzle to pump air into his rectum and filled his body with air in retaliation for quitting his job.

Judge Akbar Hossain Mridha found the main suspect in Rajon's death, Kamrul Islam, and three others guilty of fatally torturing the boy and sentenced all four to death. Four others involved in the beating death were sentenced to prison terms ranging from a year to life.

Bangladesh police escort a suspect (C) in a high-profile murder case involving the brutal killing of a child at a court in Khulna (AFP)

The main suspect fled to Saudi Arabia but was detained there and deported last month through Interpol to face trial.

Separately on Sunday, Judge Dilruba Sultana said that the owner of the car repair shop and an employee had tortured Hawlader, who later died in a hospital. Both were sentenced to death.