Yusuf 12:24
وَلَقَدْ هَمَّتْ بِهِۦ ۖ وَهَمَّ بِهَا لَوْلَآ أَن رَّءَا بُرْهَـٰنَ رَبِّهِۦ ۚ كَذَٰلِكَ لِنَصْرِفَ عَنْهُ ٱلسُّوٓءَ وَٱلْفَحْشَآءَ ۚ إِنَّهُۥ مِنْ عِبَادِنَا ٱلْمُخْلَصِينَ
Walaqad hammat bihi wahamma biha lawlaan raa burhana rabbihi kathalika linasrifaAAanhu assoo-a walfahshaa innahumin AAibadina almukhlaseen
And she certainly determined [to seduce] him, and he would have inclined to her had he not seen the proof [i.e., sign] of his Lord. And thus [it was] that We should avert from him evil and immorality. Indeed, he was of Our chosen servants.
She certainly desired him, and he might have desired her, had he not seen the proof from his Lord. Thus We did, to turn evil and lewdness away from him. Surely, he was one of Our chosen servants.