Genesis 20 (ESV)
1 From there Abraham journeyed toward the territory of the Negeb and lived between Kadesh and Shur; and he sojourned in Gerar. 2 And Abraham said of Sarah his wife, “She is my sister.” And Abimelech king of Gerar sent and took Sarah. 3 But God came to Abimelech in a dream by night and said to him, “Behold, you are a dead man because of the woman whom you have taken, for she is a man's wife.” 4 Now Abimelech had not approached her. So he said, “Lord, will you kill an innocent people? 5 Did he not himself say to me, ‘She is my sister’? And she herself said, ‘He is my brother.’ In the integrity of my heart and the innocence of my hands I have done this.” 6 Then God said to him in the dream, “Yes, I know that you have done this in the integrity of your heart, and it was I who kept you from sinning against me. Therefore I did not let you touch her. 7 Now then, return the man's wife, for he is a prophet, so that he will pray for you, and you shall live. But if you do not return her, know that you shall surely die, you and all who are yours.”
8 So Abimelech rose early in the morning and called all his servants and told them all these things. And the men were very much afraid. 9 Then Abimelech called Abraham and said to him, “What have you done to us? And how have I sinned against you, that you have brought on me and my kingdom a great sin? You have done to me things that ought not to be done.” 10 And Abimelech said to Abraham, “What did you see, that you did this thing?” 11 Abraham said, “I did it because I thought, ‘There is no fear of God at all in this place, and they will kill me because of my wife.’ 12 Besides, she is indeed my sister, the daughter of my father though not the daughter of my mother, and she became my wife. 13 And when God caused me to wander from my father's house, I said to her, ‘This is the kindness you must do me: at every place to which we come, say of me, “He is my brother.”’”
14 Then Abimelech took sheep and oxen, and male servants and female servants, and gave them to Abraham, and returned Sarah his wife to him. 15 And Abimelech said, “Behold, my land is before you; dwell where it pleases you.” 16 To Sarah he said, “Behold, I have given your brother a thousand pieces of silver. It is a sign of your innocence in the eyes of all who are with you, and before everyone you are vindicated.” 17 Then Abraham prayed to God, and God healed Abimelech, and also healed his wife and female slaves so that they bore children. 18 For the Lord had closed all the wombs of the house of Abimelech because of Sarah, Abraham's wife.