A week ago, a couple and their infant son were found murdered and two children seriously injured at their home in Mubarakpur area.
The accused Nasiruddin was arrested on Monday for the murders and police discovered that he had committed similar crimes in Haryana, Delhi and West Bengal.
He confessed to have committed horrific crimes and indulging in perversion.
During interrogation, Nasiruddin confessed that he killed the 30-year-old woman, her husband and four-month-old son before having sex with her corpse and then raping her 10-year-old daughter.
Azamgarh SP Triveni Singh said: "He engaged in sex with the body for three hours in the house and made a video of the act, which he later showed to his sister-in-law who was horrified. He also admitted to taking a stimulating drug and carried condoms for perpetrating the crime. He used a knife and a heavy stone to kill his victims."
According to the SP, late on November 24, Nasiruddin went to the woman's house when the family was asleep. He killed her 35-year-old husband, then killed her and had sex with her corpse.
Before leaving, he raped and injured the couple's minor daughter and also attacked her four-year-old brother.
"We had found the three bodies without clothes. Nasiruddin was arrested from his house on the basis of circumstantial evidence and has confessed to his crime," a police official said.
( With inputs from IANS )