Valmiki Ramayana Ayodhya Kanda Sarga 36 Shloka 23
Original Shlokaस तासां वचनं श्रुत्वा प्रकृतीनां नराधिपः। तं तत्याजाहितं पुत्रं तेषां प्रियचिकीर्षया।।2.36.23।।
1 source checked for this shloka
सः नराधिपः that king, तेषां प्रकृतीनाम् of those subjects, वचनम् words, श्रुत्वा having heard, तासाम् to all of them, प्रियचिकीर्षया with the intention of pleasing them, अहितम् malevolent, तं पुत्रम् that son, तत्याज banished.
That king (Sagara) heard the words of the citizens and with the intention of doing good to them, banished that malevolent son.