Genesis 18:16-33 KJV
And the men rose up from thence, and looked toward Sodom: and Abraham went with them to bring them on the way. And the LORD said, Shall I hide from Abraham that thing which I do; seeing that Abraham shall surely become a great and mighty nation, and all the nations of the earth shall be blessed in him? For I know him, that he will command his children and his household after him, and they shall keep the way of the LORD, to do justice and judgment; that the LORD may bring upon Abraham that which he hath spoken of him. And the LORD said, Because the cry of Sodom and Gomorrah is great, and because their sin is very grievous; I will go down now, and see whether they have done altogether according to the cry of it, which is come unto me; and if not, I will know. And the men turned their faces from thence, and went toward Sodom: but Abraham stood yet before the LORD.
And Abraham drew near, and said, Wilt thou also destroy the righteous with the wicked? Peradventure there be fifty righteous within the city: wilt thou also destroy and not spare the place for the fifty righteous that are therein? That be far from thee to do after this manner, to slay the righteous with the wicked: and that the righteous should be as the wicked, that be far from thee: Shall not the Judge of all the earth do right? And the LORD said, If I find in Sodom fifty righteous within the city, then I will spare all the place for their sakes. And Abraham answered and said, Behold now, I have taken upon me to speak unto the Lord, which am but dust and ashes: peradventure there shall lack five of the fifty righteous: wilt thou destroy all the city for lack of five? And he said, If I find there forty and five, I will not destroy it. And he spake unto him yet again, and said, Peradventure there shall be forty found there. And he said, I will not do it for forty's sake. And he said unto him, Oh let not the Lord be angry, and I will speak: Peradventure there shall thirty be found there. And he said, I will not do it, if I find thirty there. And he said, Behold now, I have taken upon me to speak unto the Lord: Peradventure there shall be twenty found there. And he said, I will not destroy it for twenty's sake. And he said, Oh let not the Lord be angry, and I will speak yet but this once: Peradventure ten shall be found there. And he said, I will not destroy it for ten's sake. And the LORD went his way, as soon as he had left communing with Abraham: and Abraham returned unto his place.