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 judgment and knowledge. As such We recompense those who do good. 22 Now the woman in whose house he was solicited him, and closed the doors on them. 'Come,' she said, 'take me!' 'God be my refuge,' he said. 'Surely my lord has given me a goodly lodging. Surely the evildoers do not 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 both raced each other to the door, and she tore his shirt from the back: they both found her lord near the door. She said: "What is the (fitting) punishment for one who formed an evil design against thy wife, but prison or a grievous chastisement?" 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 And if his shirt is rent from behind, she tells a lie and he is one of the truthful. 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 Joseph, stay away from such affairs and you, woman, ask forgiveness for your sin; the guilt is yours." 29