The Pragmatic Sanction of 1713, a legal mechanism designed to ensure that the Austrian throne and Habsburg lands would be inherited by Emperor Charles VI's daughter, Maria Theresa, was part of the law of the house of Austria.
Charles V, Holy Roman Emperor, was the most powerful member of the Habsburg dynasty, being both King of Spain with its new world empire (inherited from his maternal grandparents), and Emperor of the Germanic Holy Roman Empire because of his possession of Austria (inherited from his paternal grandfather).
In 1520, a year after his election as emperor, he ceded his Austrian territories to his brother Ferdinand I of Germany to satisfy the Prince-electors who feared he would be too powerful if he retained them. This created two branches of the house of Habsburg: the Spanish branch and the Austrian branch.
The Austrian branch later acquired the hereditary crowns of Bohemia and Hungary. The throne of the Holy Roman Empire was virtually also an Austrian heirloom; although nominally an elected post, it was held by the house of Habsburg from 1439 to 1806 with only a single five-year interruption.
As the war was in progress, Emperor Leopold I, head of the Austrian branch, tried to establish an explicit law of succession within his surviving branch of the family. Leopold I and his two sons Joseph and Charles signed a succession pact (Pactum mutuae successionis) on 12 September 1703.
This pact specified that females could succeed only when all male lines had become extinct and further specified the priorities of the then living Habsburgs.
Leopold died in 1705, and was succeeded by his son Joseph I as Emperor. Joseph I died in December 1711 leaving two daughters, who were at the time of his death unmarried. Soon afterward the Croatian parliament under the presidency of Emerik Eszterhazy voted its Pragmatic Sanction of 1712 (9 March) in which the Kingdom of Croatia accepted female inheritance of its crown after extinction of the male line
Joseph was succeeded as Emperor by his brother Charles VI, who wrote a will specifying an order of succession different from that specified in the Pactum of 1703, giving precedence to his own daughters, ahead of his late brother's daughters. Because of this conflict a convocation of the Privy Council and the Ministers of the Emperor in Vienna was called, the Pactum was read aloud, and Charles VI's modifications announced. This declaration of 19 April 1713 is called the Pragmatic Sanction of 1713.
Hungary, which had an elective kingship, had accepted the house of Habsburg as hereditary kings in the male line without election in 1687, but had not accepted semi-Salic inheritance. The Emperor-King agreed that if the Habsburg male line became extinct, Hungary would once again have an elective monarchy. This was rule in the Kingdom of Bohemia too.
Maria Theresa, however, still gained the throne of Hungary.
Charles VI spent the time of his reign preparing Europe for a female ruler, but he did not prepare his daughter, Maria Theresa. He would not read her documents, take her to meetings, not be introduced to ministers or have any preparation for the power she would receive in 1740. Charles VI did not prepare Maria because that meant giving up hope of having a son to succeed him.
Charles VI managed to get the great European powers to agree to the Pragmatic Sanction (for the time being), and died in 1740 with no male heirs. However, France, Prussia, Bavaria and Saxony reneged, and contested the claims of his daughter Maria Theresa on his Austrian lands, and initiated the War of the Austrian Succession, in which Austria lost Silesia to Prussia. The elective office of Holy Roman Emperor was filled by Joseph I's son-in-law Charles Albert of Bavaria, marking the first time in several hundred years that the position was not held by a Habsburg. As Charles VII, he lost Bavaria to the Austrian army and then died. His son, Maximilian III Joseph, Elector of Bavaria, supported Austria's claims in exchange for the return of Bavaria, and Maria Theresa's husband was elected Holy Roman Emperor as Francis I in 1745.
The Treaty of Aix-la-Chapelle, in 1748, finally recognized Maria Theresa's Habsburg inheritance.