In the very first sentences of his preface, Alexandre Dumas indicated as his source Mémoires de Monsieur d'Artagnan (1700), a historical novel by Gatien de Courtilz de Sandras, which Dumas discovered during his research for his history of Louis XIV, printed by Pierre Rouge in Amsterdam. It was in this book, he said, that d'Artagnan relates his first visit to M. de Tréville, captain of the Musketeers, where in the antechamber he met three young Béarnese with the names Athos, Porthos and Aramis. This information struck the imagination of Dumas so much—he tells us—that he continued his investigation and finally encountered once more the names of the three musketeers in a manuscript with the title Mémoire de M. le comte de la Fère, etc.. Elated—so continues his yarn—he asked permission to reprint the manuscript. Permission granted:
Now, this is the first part of this precious manuscript which we offer to our readers, restoring it to the title which belongs to it, and entering into an engagement that if (of which we have no doubt) this first part should obtain the success it merits, we will publish the second immediately.
In the meanwhile, since godfathers are second fathers, as it were, we beg the reader to lay to our account, and not to that of the Comte de la Fère, the pleasure or the ennui he may experience.
This being understood, let us proceed with our story.
The book he referred to was Mémoires de M. d'Artagnan, capitaine lieutenant de la première compagnie des Mousquetaires du Roi (Memoirs of Mister d'Artagnan, Lieutenant Captain of the first company of the King's Musketeers) by Gatien de Courtilz de Sandras (Cologne, 1700). The book was borrowed from the Marseille public library, and the card-index remains to this day; Dumas kept the book when he went back to Paris.
Following Dumas's lead in his preface, Eugène d'Auriac (de la Bibliothèque Royale) in 1847 was able to write the biography of d'Artagnan: d'Artagnan, Capitaine-Lieutenant des Mousquetaires– Sa vie aventureuse– Ses duels– etc. based on Courtilz de Sandras.
Like many of Dumas's most famous novels, The Three Musketeers was written in collaboration with Auguste Maquet, who also worked with Dumas on its sequels (Twenty Years After and The Vicomte of Bragelonne: Ten Years Later), as well as The Count of Monte Cristo. Maquet would suggest plot outlines after doing historical research; Dumas then expanded the plot, removing some characters, including new ones, and imbuing the story with his unmistakable style.
The Three Musketeers was first published in serial form in the newspaper Le Siècle between March and July 1844.
When Alexandre Dumas wrote The Three Musketeers, he also was a practising fencer and like many other French gentlemen of his generation he attended the schools for Canne de combat and Savate of Michel Casseux, Charles Lecour and Joseph Charlemont (who had been a regular fencing instructor in the French army).