In 1803 German writer Wilhelm Heinse (1746-1803) published a novella titled 'Anastasia and the Game of Chess. Letters from Italy by the Author of Ardinghello'. This is the first work of fiction in literary history that features a chess game position as part of its plot. This position is associated with a female character — Anastasia who sets a chess problem with mate in three moves. In this mate a knight and a rook (or queen) checkmate the opponent's king between the edge of the board and another of the opponent's pieces.
It's worth noting that this mate is a variation of the Corridor Mate but instead of pieces blocking the King a Knight is used.