Gaboriau was born in the small town of Saujon, Charente-Maritime. He became a secretary to Paul Féval, and after publishing some novels and miscellaneous writings, found his real gift in L'Affaire Lerouge (1866).
The book, which was Gaboriau's first detective novel, introduced an amateur detective. It also introduced a young police officer named Monsieur Lecoq, who was the hero in three of Gaboriau's later detective novels. The character of Lecoq was based on a real-life thief turned police officer, Eugène François Vidocq (1775–1857), whose own memoirs, Les Vrais Mémoires de Vidocq, mixed fiction and fact. It may also have been influenced by the villainous Monsieur Lecoq, one of the main protagonists of Féval's Les Habits Noirs book series.