The Spanish political establishment was split into pro-Austrian and pro-French factions, the latter led by
Fernández de Portocarrero, Cardinal and Archbishop of
Toledo. For most of this period, the 'Austrians' controlled government, with Maria Anna assuming leadership after Mariana of Austria died in 1696. In 1690, they supported Spain's entry into the
Nine Years War, which proved a disastrous decision; the state declared bankruptcy in 1692 and by 1696, France occupied most of
Catalonia. Maria Anna's power derived from her status as mother of the future monarch, which dissipated when it became clear this was unlikely to occur. By now, Charles was almost certainly impotent, his autopsy later revealing he had only one atrophied testicle. To offset this, she claimed to be pregnant on various occasions, and encouraged Charles to undergo treatments to increase his fertility, thus making it clear the failure to produce an heir was not her fault. In 1698, Charles fell seriously ill and his death seemed imminent. On 11 October, Britain, France and the Dutch Republic signed the
Treaty of the Hague or First Partition Treaty, an attempt to impose a solution to the Succession issue on Spain and Austria. Six year old
Joseph Ferdinand of Bavaria, was made heir to the bulk of the Spanish Empire, the rest split between France and Austria. His parents were Charles's niece
Maria Antonia and
Maximilian II Emanuel of Bavaria, a Wittelsbach like Maria Anna. The Spanish were not consulted on the partition of their Empire and unsurprisingly opposed such a solution. On 14 November 1698, Charles published his Will, naming Joseph Ferdinand his successor but stipulating he would inherit an undivided Spanish Monarchy. It also appointed Maria Anna regent during his minority, an announcement reportedly received by his Spanish councillors in silence. After Joseph Ferdinand died suddenly in 1699, France, Britain and the Dutch Republic agreed to the
Second Partition Treaty in March 1700. Joseph Ferdinand was replaced by Maria Anna's nephew,
Archduke Charles, with
Spanish possessions in Italy, the
Netherlands and Northern Spain divided between France,
Savoy and Austria. Charles modified his Will in favour of Archduke Charles, but continued to insist on an undivided Monarchy and added the requirement Spain remain independent of Austria. Most of the Castilian nobility preferred a Bourbon candidate, despite efforts by Maria Anna to ensure her nephew's succession. In June 1700, her ally
Mendoza,
Inquisitor General, arrested Charles's pro-French personal confessor Froilán Díaz, and charged him with 'bewitching' the king. When the committee set up to review the case acquitted Díaz, Mendoza ordered their arrest, seriously undermining Maria Anna, who was viewed as the instigator. A Council was established to investigate the
Inquisition itself; it survived as an institution until 1834, but its power was broken. ==Queen dowager of Spain==