Principal Sessions Judge S Santha Kumari awarded the sentence to Narendra Kumar (30), a native of Ferozabad in Uttar Pradesh.
The judge also imposed a double life sentence, along with seven years of imprisonment, on the accused and described the case as a "rarest of rare" one.
All the sentences will run concurrently.
The sentence was a "warning" to those migrant workers who indulged in crime, the court said and ordered a compensation of Rs three lakh to the relatives of the deceased.
Kumar, who worked in a laundry, committed the murders and decamped with gold ornaments and cash to repay his debts, it was alleged.
The court had found him guilty under sections 302, 397, 457 and 380 of the IPC.
Disclaimer: No Business Standard Journalist was involved in creation of this content