In addition to his children born in wedlock, Philip IV also had a number of illegitimate offspring. Of these, one son, whom he had with the actress Maria Calderón, stands out in particular: Don Juan José de Austria (1629–1679).
Don Juan was officially recognized by Philip as his illegitimate son in 1642. He was invested with the title of Grand Prior of the Order of St John of Castile-Leon so that he would have a living commensurate with his rank. Juan was also entrusted by his father with military duties, at first demonstrating great talent. He commanded the successful suppression of the revolts in Naples and Catalonia against the Castilian central government.
As governor of the Spanish Netherlands (1656–1658) however he was unable to halt the French advance, or to lead the Spanish troops to victory in 1662/63 in the attempt to bring Portugal, which had seceded in 1640, back under Spanish control.
Nonetheless, Don Juan José had broad popular support. Given the dubious condition of his half-brother Charles, the ambitious young man began to lay plans to claim the throne.
In 1663 his claim to the succession was officially rejected by his father. However, this did not stop him from pursuing his plans behind the scenes. He aspired to marry his half-sister Margarita Teresa, a union that was also vehemently rejected by his father.
On the death of Philip IV in 1665 Juan José thought his hour had come. He strove to gain influence over his half-brother Charles, who was under the tutelary regency of his mother. Defending the claims of her son, Maria Anna now became the ambitious adventurer’s main adversary. Don Juan José openly opposed the mostly unsuccessful policies of the dowager queen and her coterie of Jesuit advisors led by her confessor, Father Nithard, who hailed from Upper Austria.
Although Don Juan José succeeded in having Nithard removed by exploiting the negative mood among the populace, he was ultimately unable to gain the upper hand over Maria Anna. The dowager queen even managed to have her adversary banished from court.
In exile in Zaragoza he systematically gathered supporters around him, with the result that in 1677 he was able to celebrate a triumphant return to court that was tantamount to a military putsch.
Now the dowager queen was banished from court and the helpless King Charles II stood wholly under the tutelage of his much stronger half-brother. Officially appointed first minister, Don Juan José governed single-handedly. However, he gradually lost popularity and support due to the setbacks during his period of governance. These culminated in the Peace of Nijmwegen in 1678, in which Spain finally ceded hegemony in Western Europe to France and was forced to accept bitter losses of territory.
Don Juan José died at the age of fifty in 1679, and as a result the dowager queen returned to the political arena. Don Juan José had never married but had had a number of illegitimate daughters with a Sicilian noblewoman, all of whom entered convents. Despite having been born out of wedlock, he was buried in the Pantheon of the Escorial among the princes of the blood.