Genesis 50:20

But as for you, you meant evil against me; but God meant it for good, in order to bring it about as it is this day, to save many people alive.