Prince Joseph Ferdinand was born in Vienna on October 28, 1692, son of Duke Maximilian II Emanuel, Elector of Bavaria, and Archduchess Maria Antonia, daughter of Emperor Leopold I.
As the only surviving descendant of Margaret Theresa and a great-grandson of Philip IV, Joseph Ferdinand's claim was sound[3][4] and widely recognized in Spain.
[3][6][8][9] Charles II's mother, Mariana of Austria, recognized Joseph Ferdinand as rightful heir to the Spanish crown and firmly advocated for his claim.
[18] Her triumph was a posthumously signed will in which her son, Charles II, decreed in September 1696 his great-nephew Joseph Ferdinand of Bavaria, the heir to the monarchy.
It was in such circumstances that the King reaffirmed his Testament: I declare my legitimate successor in all my kingdoms, states and dominions, the Electoral Prince Maximilian Joseph, only son of the Archduchess Maria Antonia, my niece, and Electoral Duke of Bavaria, who was also the only child of the Empress Margaret, my sister, who married the Emperor, my uncle, first the line of succession to all my kingdoms, by the will of the king, my lord and father, as claimed by the laws of those kingdoms, as has been said; the exclusion of the Queen of France my sister wherefore the said Electoral Prince Joseph Ferdinand as sole heir of this right, a man closest to me in the most immediate and direct line, is my legitimate successor in all of them ...[23]Mariana of Neuburg reacted against the Testament by having Catalonia seized, and German troops were sent to Toledo and Madrid, while her cousin, Prince George of Hesse-Darmstadt prepared to leave Barcelona with his troops.
[citation needed] Max Emanuel of Bavaria sent for his son to come to Brussels[24] with the intention that the States of Flanders would swear an oath on the death of Charles II.
Meanwhile, Louis XIV agreed in The Hague with the maritime powers on the distribution of the Spanish Crown's lands on the death of Charles II:[6] the First Partition Treaty was signed with England on September 8 and the United Provinces on 11 October.
In his biography of Charles II, John Langdon-Davies describes the impact of the prince's death:It was as if the one iron band holding together a crumbling ruin had suddenly broken; the mystical joy gave way to very material discontent.
The population which had been exalted by patriotic fantasy into a state of euphoria that bore no relation whatever to their daily experiences, now saw life as slow starvation, with bread and all other foods scarce and dear, fields without crops, frontiers without protection, existence without hope.