The historical mystery or historical whodunit is a subgenre of two literary genres, historical fiction and mystery fiction. These works are set in a time period considered historical from the author's perspective, and the central plot involves the solving of a mystery or crime (usually murder). Though works combining these genres have existed since at least the early 20th century, many credit Ellis Peters's Cadfael Chronicles (1977-1994) for popularizing what would become known as the historical mystery. The increasing popularity and prevalence of this type of fiction in subsequent decades has spawned a distinct subgenre recognized by the publishing industry and libraries.Publishers Weekly noted in 2010 of the genre, "The past decade has seen an explosion in both quantity and quality. Never before have so many historical mysteries been published, by so many gifted writers, and covering such a wide range of times and places." Editor Keith Kahla concurs, "From a small group of writers with a very specialized audience, the historical mystery has become a critically acclaimed, award-winning genre with a toehold on the New York Times bestseller list."
Since 1999, the British Crime Writers' Association has awarded the CWA Historical Dagger award to novels in the genre. The Left Coast Crime conference has presented its Bruce Alexander Memorial Historical Mystery award (for mysteries set prior to 1950) since 2004.
Though the term "whodunit" was coined sometime in the early 1930s, it has been argued that the detective story itself has its origins as early as the 429 BC Sophocles play Oedipus Rex and the 10th century tale "The Three Apples" from One Thousand and One Nights (Arabian Nights). During China's Ming Dynasty (1368-1644), gong'an ("crime-case") folk novels were written in which government magistrates — primarily the historical Di Renjie of the Tang Dynasty (618-907) and Bao Zheng of the Song Dynasty (960-1279) — investigate cases and then as judges determine guilt and punishment. The stories were set in the past but contained many anachronisms. Robert van Gulik came across the 18th century anonymously-written Chinese manuscript Di Gong An, in his view closer to the Western tradition of detective fiction than other gong'an tales and so more likely to appeal to non-Chinese readers, and in 1949 published it in English as Celebrated Cases of Judge Dee. He subsequently wrote his own Judge Dee stories (1951-1968) in the same style and time period.