And Abimelech became impotent, and all the women of his house became barren, even || to the smallest insect (which also became) barren, as it is said, "For the Lord had fast closed up all the wombs of the house of Abimelech" (Gen. 20:18). And the angel Michael descended and drew his sword against him. Abimelech said to him: Is this a true judgment and a true sentence to slay me as long as I had no knowledge? "Wilt thou slay even a righteous nation?" (Gen. 20:4). He said unto him: "Restore the man's wife, for he is a prophet" (Gen. 20:7). "And he shall pray for thee, and thou shalt live" (ibid.).
Abimelech Among the Heavenly Host
Pirkei DeRabbi Eliezer 26:8