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 he reached maturity, We bestowed on him right judgement and knowledge. Thus We reward those who do good. 22 His master's wife then tried to seduce him. She locked the doors and said to him, "Come on." He said, "I seek refuge in God who has given me a good place of shelter. The unjust will certainly have no happiness." 23 She verily desired him, and he would have desired her if it had not been that he saw the argument of his Lord. Thus it was, that We might ward off from him evil and lewdness. Lo! he was of Our chosen slaves. 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 (Joseph) said: "It was she who wanted to seduce me." And a witness from her family testified: "If the shirt is torn from the front then the woman is speaking the truth, and he is a liar. 26 but if his tunic has been torn from behind, then she is lying, and he is speaking the truth." 27 So when her husband saw his shirt torn from the back, he said, "Indeed, it is of the women's plan. Indeed, your plan is great. 28 [But,] Joseph, let this pass! And thou, [O wife,] ask forgiveness for thy sin - for, verily, thou hast been greatly at fault!" 29