The Egyptian that bought him said to his wife: 'Make his stay honorable. He may benefit us, or take him for our son' As such We established Joseph in the land, so that We might teach him the interpretation of visions. Allah prevails in His affairs, though most people do not know. 21 And when Joseph reached maturity, We gave him judgment and knowledge. And thus We reward the doers of good. 22 And the woman in whose house he was, allured him not to restrain himself and she closed all the doors – and said, “Come! It is you I address!”; he said, “(I seek) The refuge of Allah – indeed the governor is my master – he treats me well; undoubtedly the unjust never prosper.” 23 She started towards him, and he would have succumbed to her, if he had not seen a sign from his Lord -- We did this in order to keep evil and indecency away from him, for he was truly one of Our chosen servants. 24 And they both raced towards the door, and the woman tore his shirt from behind, and they both found her husband at the door; she said, “What is the punishment of the one who sought evil with your wife, other than prison or a painful torture?” 25 He (Joseph) said: 'It was she who sought to seduce me' and a witness (an infant) of her people bore witness, saying: 'If his shirt is torn from the front, she is speaking the truth and he is one of the liars, 26 but if his shirt is torn from behind, she is lying and he is speaking the truth." 27 So when he saw his shirt rent from behind, he said: Surely it is a guile of you women; surely your guile is great: 28 Joseph, turn away from this; and thou, woman, ask forgiveness of thy crime; surely thou art one of the sinners.' 29