LAHORE, Pakistan (AP) — A man convicted of killing eight children was executed at a Pakistani prison early Wednesday after the country's top court rejected a request for his public hanging, officials said.

Mohammad Imran was hanged in the eastern city of Lahore in the presence of the father of 7-year-old Zainab Ansari, whose rape and murder in January ignited nationwide outrage. Imran was arrested two weeks after he threw the body into a garbage dump in the city of Kasur in Punjab province.

After his arrest, Imran confessed to the other slayings and was convicted by a court. Other courts later upheld his death sentence.

"Imran was taken to the gallows just before dawn and he has been hanged with a rope in the presence of magistrate and a doctor," local police official Mohammad Afzal said. Zainab's father, Mohammed Amin Ansari, was allowed to witness the execution.

Ansari had demanded that Imran should be hanged at some public place in order to deter others, but the judges rejected his plea this week. Shortly after witnessing Imran's execution, Ansari thanked the judiciary, government and investigators for giving them speedy justice.

"My daughter will not come back, but I am satisfied that we got justice," he said.

Authorities handed over the body of Imran to his family and he was expected to be buried later Wednesday.

Zainab's rape and murder shocked the nation after a photo of her went viral on social media, showing the smiling girl in her favorite bright pink coat, with a pink barrette in her hair. Pakistanis rallied across the country, demanding the immediate arrest of the killer.

Ansari was on a pilgrimage in Saudi Arabia with his wife at the time of his daughter's disappearance.

His daughter disappeared while going to a nearby home for Quranic studies.

___

Associated Press writer Munir Ahmed in Islamabad contributed to this story.

Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.