information:highlighting, linguistic:paraphrasing, linguistic:voice_change, structural:summarization, structural:expansion
Early Arabic

One Thousand and One Nights contains several of the earliest detective stories, anticipating modern detective fiction. The oldest known example of a detective story was " The Three Apples ", one of the tales narrated by Scheherazade in the One Thousand and One Nights (Arabian Nights). In this story, a fisherman discovers a heavy, locked chest along the Tigris river, which he then sells to the Abbasid Caliph, Harun al-Rashid. When Harun breaks open the chest, he discovers the body of a young woman who has been cut into pieces. Harun then orders his vizier, Ja'far ibn Yahya, to solve the crime and to find the murderer within three days, or be executed if he fails in his assignment. Suspense is generated through multiple plot twists that occur as the story progressed. With these characteristics this may be considered an archetype for detective fiction. It anticipates the use of reverse chronology in modern detective fiction, where the story begins with a crime before presenting a gradual reconstruction of the past.

The main difference between Ja'far ("The Three Apples") and later fictional detectives, such as Sherlock Holmes and Hercule Poirot, is that Ja'far has no desire to solve the case. The whodunit mystery is solved when the murderer himself confessed his crime. This in turn leads to another assignment in which Ja'far has to find the culprit who instigated the murder within three days or else be executed. Ja'far again fails to find the culprit before the deadline, but owing to chance, he discovers a key item. In the end, he manages to solve the case through reasoning in order to prevent his own execution.

On the other hand, two other Arabian Nights stories, "The Merchant and the Thief" and "Ali Khwaja", contain two of the earliest fictional detectives, who uncover clues and present evidence to catch or convict a criminal known to the audience, with the story unfolding in normal chronology and the criminal already known to the audience. The latter involves a climax where the titular detective protagonist Ali Khwaja presents evidence from expert witnesses in a court.