He that bought him, being of Egypt, said to his wife, 'Give him goodly lodging, and it may be that he will profit us, or we may take him for our own son.' So We established Joseph in the land, and that We might teach him the interpretation of tales. God prevails in His purpose, but most men know not. 21 And when he reached maturity, We bestowed on him judgment and knowledge. As such We recompense those who do 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 And indeed, she desired him, and he desired her; [and he would have succumbed] had he not seen [in this temptation] an evidence of his Sustainer's truth: thus [We willed it to be] in order that We might avert from him all evil and all deeds of abomination - for, behold, he was truly one of Our 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 said: She sought to make me yield (to her); and a witness of her own family bore witness: If his shirt is rent from front, she speaks the truth and he is one of the liars: 26 But if the shirt is torn from behind then she is a liar, and he speaks 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 “O Yusuf! Disregard this – and O woman! Seek forgiveness for your sin; indeed you are of the mistaken.” 29