It is not until Genesis 19 that we learn that the people who have come to visit Abraham and tell him that he is going to have a son this time next year were angels. These angels have also declared that they have come to see if these cities are worthy of the judgment since the outcry against them have been heard by God (18:20-21). Abraham has been invited to have a conversation with God and in this discussion has asked God to preserve the cities if 10 righteous people can be found in them. God promised that if there were 10 righteous people that the judgment would be averted.
To read more of this lesson click here.