Genesis 20:1-8

1 And Abraham journeyed from there to the South, and dwelt between Kadesh and Shur, and stayed in Gerar.
2 Now 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, "Indeed you are a dead man because of the woman whom you have taken, for she is a man's wife."
4 But Abimelech had not come near her; and he said, "Lord, will You slay a righteous nation also?
5 Did he not say to me, 'She is my sister'? And she, even she herself said, 'He is my brother.' In the integrity of my heart and innocence of my hands I have done this."
6 And God said to him in a dream, "Yes, I know that you did this in the integrity of your heart. For I also withheld you from sinning against Me; therefore I did not let you touch her.
7 Now therefore, restore the man's wife; for he is a prophet, and he will pray for you and you shall live. But if you do not restore her, know that you shall surely die, you and all who are yours."
8 So Abimelech rose early in the morning, called all his servants, and told all these things in their hearing; and the men were very much afraid.