Genesis 50:20

NASB
"As for you, you meant evil against me, but God meant it for good in order to bring about this present result, to preserve many people alive.