The Kingdom of France faces bankruptcy from King Louis XIV's wars against the Dutch, causing French citizens to starve. As the country moves toward revolution, King Louis prepares for war. At this point, the four musketeers have gone their separate ways; Aramis is now a priest, Porthos is a womanizing drunkard, and Athos has retired to his farm. Only D'Artagnan has remained loyal to the musketeers and is now the captain.
Athos' only son, Raoul, aspires to join the musketeers. At a palace festival, Louis sets his eyes on Christine Bellefort, Raoul's fiancée. He immediately plots to send Raoul to the battlefront, where he is killed soon after. Aware that Louis orchestrated his son's death, Athos renounces his allegiance to the king. After an assassination attempt on Louis by the Jesuit order is foiled by D'Artagnan, Louis instructs Aramis to hunt down and kill their leader. In response, Aramis summons Porthos, Athos, and D'Artagnan for a secret meeting in which he reveals he is the Jesuit's secret leader and has a plan to depose Louis. Athos and Porthos agree to join him, but D'Artagnan refuses. Athos brands him a traitor and threatens him with death should they ever meet again. Meanwhile, Louis seduces Christine, who now suspects his part in Raoul's death.
The musketeers infiltrate the Île Sainte-Marguerite prison and free a prisoner wearing an iron mask. The prisoner is taken to the countryside, where Aramis reveals he is Philippe, King Louis' brother. Their mother, Queen Anne, gave birth to identical twin sons. Louis XIII, to avoid dynastic warfare between his sons, sent Philippe to live in the countryside while naming Louis XIV as heir. After Louis XIII died, Anne revealed Philippe's existence to Louis XIV. He was too superstitious to have his brother killed and instead imprisoned him in the iron mask to conceal his identity, an act that Aramis executed. Aramis wishes to redeem himself and save France by replacing Louis with the more benevolent Philippe. The musketeers tutor Philippe in courtly life and how to behave like Louis. Meanwhile, Athos develops paternal feelings for Philippe.
At a masquerade ball, the musketeers lure Louis to his quarters and subdue him. They dress Philippe in Louis clothes and return him to the festivities while taking Louis to a waiting boat in the dungeons. D'Artagnan, however, sees through the ruse after Christine publicly accuses Louis (Philippe) of the king's role in Raoul's death. He forcibly escorts Philippe to the dungeons. Musketeer soldiers intervene before Athos, Porthos, and Aramis can escape with Louis. The king is rescued as the three musketeers get away. Though Louis is prepared to kill Philippe, D'Artagnan begs that he be spared. Louis orders Philippe back to the Bastille to wear the iron mask. Soon after, a grieving Christine commits suicide.
D'Artagnan contacts the musketeers to help rescue Philippe from the Bastille. Louis, suspecting an attempt, ambushes them at the prison. Louis offers D'Artagnan clemency in exchange for surrender. D'Artagnan refuses, privately telling his comrades that he is Louis and Philippe's father from an affair with the Queen, and is the reason for his loyalty to Louis. As they charge one final time at Louis and his men, they are fired upon; their bravery compels the soldiers to close their eyes before firing and all miss. Louis attempts to stab Philippe but fatally wounds D'Artagnan. Philippe nearly strangles Louis to death but D'Artagnan's dying words halt him. D'Artagnan's top lieutenant, Andre, angered by his mentor's death, swears his men to secrecy and sides with Philippe. They switch the twins again and Philippe orders Louis locked away, then names Athos, Porthos, and Aramis as his closest advisors.