The Egyptian who bought him instructed his wife: "House him honourably. He may be of use to us. We may even adopt him as a son." So, We firmly established Joseph in the land, and taught him the interpretation of dreams. God dominated in his affairs, though most men do not know. 21 And when he had attained his maturity, We gave him wisdom and knowledge: and thus do We reward those who do good. 22 However, the woman in whose house he lived, wanted to seduce him. One day she bolted the doors and said, "Come!" He replied, "God forbid! Truly [your husband] is my master and has treated me honourably. Wrongdoers certainly never prosper." 23 But the woman desired him, and he would have desired her but for the indication he received from his Lord. This was so that We may avert both evil and lechery from him, for he was one of Our chosen devotees. 24 And they raced with one another to the door, and she tore his shirt from behind, and they met her lord and master at the door. She said: What shall be his reward, who wisheth evil to thy folk, save prison or a painful doom? 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 And if his shirt is rent from behind, she tells a lie and he is one of the truthful. 27 So when he saw his shirt torn from behind [her husband] said, "This is the guile of you women. Your guile is great indeed. 28 "O Yusuf (Joseph)! Turn away from this! (O woman!) Ask forgiveness for your sin. Verily, you were of the sinful." 29