"And the men turned away from there" (Genesis 18:22) — for [the Holy One] cleared away from them every measure of mercy. "But Abraham was still standing before the LORD" — from here you learn that the Holy One, blessed be He, hearkened to Abraham, who had said, "Do not, I pray, pass on from your servant" (Genesis 18:3).
Abraham Stands Before the LORD as Mercy Turns From Sodom
Midrash Aggadah, Genesis 18:22
ויפנו משם האנשים. שפינה מהם כל מדת רחמים: ואברהם עודנו עומד לפני ה'. מכאן אתה למד שהקב"ה שמע לאברהם שאמר אל נא תעבור מעל עבדך (בראשית יח ג):