The man from Egypt who bought him said to his wife: "Take good care of him, possibly he might be of benefit to us or we might adopt him as a son." Thus We found a way for Joseph to become established in that land and in order that We might teach him to comprehend the deeper meaning of things. Allah has full power to implement His design although most people do not know that. 21 When he attained maturity, God gave him strength, wisdom and knowledge. Thus, do We reward those who do good. 22 And it so happened that the lady in whose house Joseph was living, sought to tempt him to herself, and one day bolting the doors she said: "Come on now!" Joseph answered: "May Allah grant me refuge! My Lord has provided an honourable abode for me (so how can I do something so evil)? Such wrong-doers never prosper." 23 She was determined to have him and were it not for his faith in God, he would certainly have yielded to her. Thus did We protect him from evil and indecency. He was certainly one of Our sincere servants. 24 So they raced with one another to the door, and she tore his shirt from the back. They both found her lord (i.e. her husband) at the door. She said: "What is the recompense (punishment) for him who intended an evil design against your wife, except that he be put in prison or a painful torment?" 25 Said he, 'It was she that solicited me'; and a witness of her folk bore witness, 'If his shirt has been torn from before then she has spoken truly, and he is one of the liars; 26 And if his shirt be rent from behind, then she lieth, and he is of the truth-tellers. 27 So when he saw his shirt,- that it was torn at the back,- (her husband) said: "Behold! It is a snare of you women! truly, mighty is your snare! 28 O Yusuf! turn aside from this; and (O my wife)! ask forgiveness for your fault, surely you are one of the wrong-doers. 29