The Three Musketeers was first published in serial form in the magazine Le Siècle between March and July 1844.
In the very first sentences of his preface Alexander Dumas indicated as his source Mémoires de Monsieur d'Artagnan, 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 antichambre he met three young men 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:
"Well, it is the first part of this precious manuscript that we offer today to our readers, while giving it back its more convenient title and under the engagement to publish immediately the second part should this first part be successful. In the meantime, as the godfather is as good as a second father we invite the reader to address himself to us, and not to the Comte de La Fère, about his pleasure or boredom. This being said, let's get on 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.
Attention to the extent of Alexander Dumas' preface is called for when compared with the recent analysis (2008) of the book's origin by Roger Macdonald in his The Man in the Iron Mask:The True Story of the Most Famous Prisoner in History and the Four Musketeers where the identity of the man in the iron mask, namely d'Artagnan is presented as real history.
Following Alexander Dumas' 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. This work and especially its introduction with reference to the preface is uncited by Macdonald.
In Paris, d'Artagnan goes straight to the hangout of the Musketeers, but without his father's letter he is received somewhat coldly. The same day, d'Artagnan is challenged to a duel by three musketeers: Athos, Porthos, and Aramis, who happen to be very close friends and who encounter d'Artagnan one after the other. The four men meet and, d'Artagnan begins to fight Athos (the first challenger). They are interrupted by the Cardinal Richelieu's guards, who threaten to arrest them because duels are forbidden by royal decree. The three musketeers and d'Artagnan unite to defeat the Cardinal's guards. In this manner, the young Gascon earns the respect and friendship of Athos, Porthos and Aramis, and becomes a soldier in the Royal Guard. This is the first step in becoming a Musketeer.
After obtaining lodging and hiring a servant (Planchet), he meets his aging landlord's pretty young wife, Constance Bonacieux, with whom he falls instantly in love. She is dressmaker and confidant to the Queen, Anne of Austria. Unhappy in her marriage with Louis XIII, the Queen flirts with the English Prime Minister, the Duke of Buckingham. Constance and d'Artagnan help the two meet, and the Queen presents her lover some diamond jewels originally given to her by her husband the King. However, Cardinal de Richelieu, informed by his spies of the gift, persuades the King to invite the Queen to a ball where she would be expected to wear the diamonds.
D'Artagnan and his friends leave for London to get the diamonds back from Buckingham. The voyage is full of dangers set by the Cardinal. Athos, Porthos and Aramis are badly wounded on the way; only d'Artagnan arrives in England. He retrieves the jewels and returns them to Queen Anne, just in time to save her facade of honour.
The Cardinal is impressed enough to invite d'Artagnan to join his own corps, but the lad passes on this offer out of loyalty to his friends. Since he is not in the Cardinal's service, he does not have the Cardinal's protection, however.
The Cardinal's revenge comes swiftly: the next evening, Constance is kidnapped. D'Artagnan brings his friends back to Paris and tries to find her, but fails. Meanwhile, he befriends the Count de Winter, an English nobleman who introduces him to his sister-in-law, Milady de Winter. Despite his love for Constance and his suspicions that Milady is the Cardinal's spy, he finds it very hard to resist her charms. He almost falls into the trap, believing Milady is in love with him, when he accidentally finds a letter of hers to the one she really loves, the Count de Wardes. Helped by Milady's chambermaid Kitty, who is infatuated with him, d'Artagnan has his revenge: he spends a night with Milady, pretending to be M. de Wardes in the darkened room, and Milady gives him a sapphire ring as a token of her love. He admits the truth though, and she tries to slay him with a dagger. In the struggle, d'Artagnan discovers that Milady has a fleur-de-lis burned into her shoulder, marking her as a felon. Remembering a story that Athos had once told him, d'Artagnan suddenly realizes with horror that Milady is not, as he thought, an English noble lady, but in fact Athos' wife, whom everyone thought dead. He now knows that Milady will never forgive him for having insulted her so dearly, and is relieved when all the King's Guards are ordered to La Rochelle where a siege of the Protestant-held town is taking place.
The Musketeers and d'Artagnan are forced to purchase horses and equipment for field service -- this is no easy task for the impoverished Musketeers. Aramis has a mistress or two with gold in their pocketbook. Porthos is forced to rely on the wife of a miserly old lawyer to get the needed equipment. D'Artagnan splits with Athos money he received in selling the sapphire ring after Athos recognizes it as the ring he had given to his wife a long time ago. In the end, they are all able to join the La Rochelle campaign in reasonable style.
Milady makes several attempts to kill d'Artagnan in and around La Rochelle, but fails. At the same time, d'Artagnan finds out that the Queen has managed to save Constance from the prison where the Cardinal and Milady had thrown her, and that his beloved is now hidden somewhere safe. One of the would-be assassins drops a valuable tip: the name of an inn where Milady was to pay him for his crime.
Athos, Porthos and Aramis go to the specified inn and are surprised to overhear a conversation between the Cardinal and Milady: Richelieu commands her to assassinate the Duke of Buckingham, and in exchange, she asks him to "take care" of d'Artagnan. He will take no direct action but instead writes a blanket pardon for Milady: "By My Hand, and for the good of the State, the bearer has done what has been done." Once the Cardinal leaves, Athos confronts Milady and threatens her life, forcing her to hand over the document. The Comte de le Fère, as Athos was once known, is fully aware of her past, and Milady fears him among all men.
When the four friends are reunited, Athos presents d'Artagnan the pardon issued by the Cardinal to Milady and urges the young man to keep it for his own use. Because of the war between France and England, any attempt by the musketeers to travel to England and warn the Duke of Buckingham would be considered treason. They decide to attempt to save the Duke by writing to the Count de Winter (who had returned to England after the war started) asking him to deal with his sister-in-law. The trusty Planchet, d'Artagnan's faithful servant, is chosen to carry this letter which is purposely vague to prevent them being condemned. The Count received the note just in time, heeds their advice, and apprehends Milady. She is held prisoner in a seaside castle under the guard of a Puritan named John Felton who is seemingly incorruptible.
In the meantime, at La Rochelle, the Cardinal himself admires d'Artagnan's courage in the siege and suggests that M. de Treville admit him to the Musketeers. Thus, d'Artagnan's greatest dream comes true and he is extremely happy, for, in addition, the Queen has finally agreed to tell him where Constance is hiding: she is in a monastery near Béthune, in northern France. D'Artagnan and his friends depart for Bethune as soon as they are able.
Imprisoned in England, Milady seduces the hard-hearted Felton and convinces him not only to help her escape, but also to assassinate the Duke of Buckingham. While the naive Felton knives the Prime Minister, Milady sails to France. She writes the Cardinal to announce that his orders have been fulfilled and that she will be in a safe place until she receives payment for the crime. As Fate would have it, Milady hides in the same monastery where Constance had been sent by the Queen. Not knowing who this stranger really is, the trusting Constance bares her soul to Milady. The scheming Milady realizes that her enemy d'Artagnan is expected to arrive at the monastery at any moment. She escapes just before his arrival, but not before taking her revenge: she poisons Constance, who dies minutes later in the arms of her beloved d'Artagnan.
The Count de Winter is encountered soon after and gives the quartet the news of the Duke's assassination. The five of them arrange to track down the whereabouts of Milady and exact punishment. Athos leaves to fetch a mysterious man in a red cloak. The party track down the Countess' location: an isolated house on the banks of the Lys river near Flanders. She is trapped. The six noblemen try the Countess on numerous charges: the poisoning of Madame Bonacieux, the assassination attempts on d'Artagnan, accomplice to the assassination of the Duke of Buckingham, the corruption of the Lord de Winter's servant, Felton, and the assassination of her late husband Count de Winter (the brother of the current Lord de Winter). The most damning charge comes when Athos states that Milady, his wife, is a marked criminal with a brand on her shoulder. When the Countess demands that Athos present the one who branded her, the man in the red cloak steps forward. She immediately recognizes him as the executioner of Lille. The executioner then recounts Milady's early history.
She was a beautiful teenage nun who seduced the priest of her church -- the executioner's own brother. Desperate for money to flee to another part of the country, the priest stole sacred vessels and sold them, but the two were caught and held in jail. Milady seduced the jailer's son to escape. The priest was condemned to branding with a Fleur de Lys and a prison term. The executioner of Lille, who had to brand the priest, who was his own brother, then decided to track down Milady so as to give her the same punishment. While the executioner did this, his brother escaped from the prison and rejoined her. They fled to the province where the Count of la Fère was lord, pretending to be brother and sister. She then abandoned the priest to become Athos' wife. The priest, thus ruined and abandoned, learned that his brother the executioner was being held in prison in lieu of himself. He surrendered to free his brother and then committed suicide.
After Milady is beheaded (in Flanders, technically), the musketeers return to La Rochelle. On their way, they encounter the Count of Rochefort, the Cardinal's close advisor and d'Artagnan's old nemesis, who was traveling to Milady to pay her. Rochefort also has an order to arrest d'Artagnan if he happens to find him. As they are near La Rochelle, he decides to postpone his trip to Milady in order to take d'Artagnan directly to the Cardinal. When d'Artagnan is presented before him, the Cardinal tells the young man his charges: mostly trumped-up ones intended to provide an excuse for Milady's desire to see d'Artagnan dead. The young musketeer tells the truth to Richelieu and recounts the entire story about Milady, her assassination attempts against him, her poisoning of Madame Bonacieux, etc. The Cardinal states that if Milady is indeed guilty, the courts will deal harshly with her. D'Artagnan frankly admits that they have already dealt with this evil woman. D'Artagnan then presents him the pardon that Athos forced from Milady, making his actions legitimate in the eyes of the Law. The Cardinal, impressed by d'Artagnan's bravery and having already used Milady's services to eliminate France's arch-rival Buckingham, offers the young man a lieutenant's commission with the Musketeers -- with the name left blank. The Cardinal then presents Rochefort and asks both men to be on good terms.
D'Artagnan offers each of his friends the commission, but all three refuse, both due to personal reasons and because they believe that d'Artagnan is the most worthy of the commission. He is the only one of the four friends that remains in the Army: Athos retires to his estates, Porthos marries a rich widow and establishes himself somewhere in the countryside, and Aramis becomes a priest. Their lives, however, would cross once again, in Twenty Years After.
In 1939, American author Tiffany Thayer published a book entitled Three Musketeers (Thayer, 1939). This is a re-telling of the story in Thayer's words, true to the original plot but told in a different order and with different points of view and emphasis from the original. For example, the book opens with the scene of Milady's youth and how she came to be branded, and more development of her early character, making her later scheming more believable and understandable. Thayer's treatment of sex and sexual politics is more explicit than typical English translations of the original, occasionally leading to consternation when this book found its way to library children's sections and school libraries.
The Polish novelist Henryk Sienkiewicz acknowledged that the main characters in his well-known historical novel series, The Trilogy, were directly inspired by The Three Musketeers, with the addition of a character based on Shakespeare's John Falstaff.
For his part, science fiction writer Jack Williamson made no secret of having borrowed from both Dumas and Sienkiewicz, and putting similar characters at the center of his own successful Legion of Space Series.
Arturo Perez-Reverte's Le Club Dumas uses a 'lost' manuscript chapter of The Three Musketeers as a plot device, and makes frequent reference to the works of nineteenth century writers, including Stendhal as well as Dumas.