The non-binding resolution follows a spate of high-profile child sex-abuse cases that have provoked outrage and riots across Pakistan in recent years.
Child killers and rapists "should not only be given the death penalty by hanging, but they should be hanged publicly," said Ali Muhammad Khan, Pakistan's parliamentary affairs minister, who presented the resolution in the national assembly, or lower house.
"The Quran commands us that a murderer should be hanged," Khan added.
Though a majority of lawmakers approved the resolution, human rights minister Shireen Mazari stressed it was not sponsored by the government.
The resolution "on public hangings was across party lines and not a govt-sponsored resolution but an individual act. Many of us oppose it - our MOHR (human rights ministry) opposes this," Mazari tweeted.
Child sexual abuses are rampant in Pakistan.
In October 2018, authorities hanged a child rapist in an infamous case in Kasur, near Lahore, that sparked nationwide protests.
In that case, the six-year-old victim, Zainab Fatima Ameen, had been attacked by a 24-year-old man who went on to confess to her rape and murder.
Authorities in Kasur also uncovered a massive paedophilia ring in 2015.
In a scandal that rocked the country, at least 280 children were sexually abused by a gang who blackmailed their parents by threatening to leak the videos.
Amnesty International voiced its concern over Friday's resolution, while urging Pakistan to focus on better protections against child abuse, including through fair trials without recourse to the death penalty.
"Public hangings are acts of unconscionable cruelty and have no place in a rights-respecting society," Amnesty said in a statement.
Human rights organisations have long called on Pakistan to reinstate a moratorium on the death penalty, which was lifted after the Army Public School massacre in Peshawar in 2014 that killed 151 people, most of them students.
"There is no empirical evidence to show that public hangings are a deterrent to crime or in protecting the psycho-social well-being of children", Sarah Belal, executive director of Justice Project Pakistan, a non-profit group campaigning against the death penalty, told AFP.
In March 2016, Pakistan introduced a law criminalising sexual assault against minors, child pornography and trafficking. Previously, only acts of rape and sodomy were punishable by law.