Cumberland City Council, which covers a population of about 240,000 people living near Parramatta, narrowly voted earlier in May to "take immediate action to rid same-sex parents books/materials in council's library service".
But following community outrage and with the council's funding under threat, members met on Wednesday night to debate the ban.
Religious leaders, students, equality advocates and local families packed the chamber's public gallery to argue for and against returning the book to shelves.
Mayor Lisa Lake was forced to evict multiple unruly attendees after repeatedly warning them to let speakers to continue without interruption.
Meanwhile, fiery scenes played out outside as hundreds of protesters clashed in a tense stand-off.
Fiery scenes erupted outside the meeting. (Paul Braven/AAP PHOTOS)
Former mayor Steve Christou, the councillor who first put forward the motion, maintained the community wanted the book banned.
"I'm only echoing the views of my community," he told the meeting while asserting it was "not an attack on gay or same-sex couples".
"We cannot have toddlers just asking parents questions about genders and non-binaries," he added.
But local leaders and community members disagreed.
"You can ban a book on same sex parents but this won't stop me, my friends, my family from picking up our kids from school or playing in the local park," one woman said.
"You will have to ban us from your community too."
Protesters disputed claims that their community wanted a ban on same-sex parenting books. (Paul Braven/AAP PHOTOS)
Local couple Sandy and Ady Fitter said diversity was their community's strength.
"If you don't want to read the book, then don't read it," Ms Fitter told AAP.
"Keep your views at home if they're hateful."
After four hours of debate, councillors Kun Huang, Sabrin Farooqui, Diane Colman, Suman Saha and Mohamad Hussein all voted to rescind the ban shortly before 11pm.
Mr Huang said the amended vote was a chance to "correct the mistake made by the last meeting".
Ms Farooqui said the ban sent a harmful message and could result in $750,000 in council funding being removed.
"If the book contradicts your religious values, don't read it," she said.
"My child should be aware of the reality and this is the reality of Australia."
Parents Sandy and Ady Fitter say diversity is their community's strength. (Paul Braven/AAP PHOTOS)
Cr Hussein earlier said his religious views had strongly guided his decision in voting in favour of the ban.
"The vast majority of residents in our area have religious beliefs. Mine isn't an isolated view but one shared by a significant portion of our community," he said.
However he reversed his position at the last minute in support of the change.
Five copies of the book A Focus On: Same Sex Parents have been in the council's libraries since 2019. It has been borrowed once.
It forms part of a series that aims to inform children about "difficult realities" and "healthy ways for children to process and understand them".