Attaf, a man living in Damascus, is known for his generosity. One night, Harun al-Rashid wakes up feeling serious and goes to the treasury with his vizier, Ja'far, to read a book. While reading, he weeps three times an laughs three times. Ja'far asks why, and the caliph sends him away and tells him to return only when he understands why. Ja'far's father, Yahya, advises him to go to Damascus.
In Damascus, Ja'far mets Attaf, who invites him to stay and attend his banquet. Ja'far stays for four months and one day and sees a beautiful woman falling in love with her. He describes her to Attaf, who realizes that the woman is his wife but generously divorces her so that Ja'far can marry her. After the wedding, Ja'far takes her home to Baghdad. An envious person accuses Attaf of murder, so Attaf, to protect his neighbors from suspicion, generously makes a false confession to the crime. He's arrested, but the warden lets him escape and he goes to Baghdad. On the way he is robbed, and arrives in rags. He tries to take shelter in an abandoned building, but finds a corpse there. A police chief happens to be passing by and arrests him for murder.
Meanwhile, Ja'far has found out that his bride was Attaf's wife, and puts her in a separate palace and refrains from having intercourse with her. He tells the caliph about all this, and the caliph shows him the book which made him weep and laugh, which had that exact story writen down. Meanwhile, Attaf has yet again generously confessed to committing murder and is about to be executed. Ja'far summons him, listens to his story, and the caliph shows him the book and makes him governor of Syria.
- This story originates from Dom Chavis' manuscript in 1792, but the motifs, such as a generous man giving his wife to a guest, are very widespread in other tales.