R. Judah bar Shallum the Levite said: The students proceed first and after that, the master; but the Holy One does not act so. Rather, for the sake of Abraham, who was sitting in pain (due to his recent circumcision in Gen. 17:26), the Holy One said to his angels: Let us go and visit Abraham. While they were proceeding, first God appeared to him and after that, the angels. It is so stated (in Gen. 18:1): THEN THE LORD APPEARED UNTO HIM BY THE TEREBINTHS OF MAMRE, and after that (in vs. 2): RAISING HIS EYES, HE LOOKED; AND HERE WERE THREE MEN. Ergo: AND YOUR HUMILITY HAS MAGNIFIED ME.
God Visited Abraham Before the Angels Arrived
Midrash Tanchuma Buber, Bereshit 4:5