Gaspar Alfonso Pérez de Guzmán, 9th Duke of Medina Sidonia

Gaspar Alfonso Pérez de Guzmán y Sandoval, 9th Duke of Medina Sidonia (1602–1664) was a Spanish nobleman who became Duke of Medina Sidonia in 1636, upon the death of his father Juan Manuel Pérez de Guzmán, 8th Duke of Medina Sidonia. He was one of the architects of the Andalusian independentist conspiracy (1641).

Biography
The Duke succeeded his father as Captain General of Andalucía and the Atlantic Ocean (Mar Océano).

In 1640, his sister Luisa of Guzman became the new Queen of Portugal, as the wife of the former Duke of Braganza, now John IV of Portugal. In 1641 the 9th Duke led the Andalusian rebellion against Spanish rule. Though both Portugal and Catalonia had strong cultural identities, an historical record of independence, and popular support, Andalusia did not, and the rebellion failed. The duke had the support of his brother-in-law, John IV of Portugal, but the promised naval aid from France and the Netherlands did not arrive.

The king of Spain did not condemn him to death, but neither did he forgive his treason. The domain of Sanlúcar was confiscated, which dealt a mortal blow to the income of Medina Sidonia. The Duke was also banished to the Castillo de Coca in Central Spain, then to Tudela de Duero and finally to Valladolid, where he died in 1664. He was always guarded to prevent that he would flee to France or Portugal or incite revolt in Castile. The previous prestige of the house of Medina Sidonia was only regained by his son and successor.

Marriage and children
In 1622, aged 20, he married his 14-year-old aunt Ana María de Guzmán (1607–1637), having four children by her of which only the youngest survived: In March 1640, the 9th Duke was married for a second time to Seville noblewoman Juana Fernández de Córdoba (1611-1680), daughter of the V Marquess of Priego. They had 3 children including :
 * Gaspar Juan Pérez de Guzmán, 10th Duke of Medina Sidonia (1630-1667) : inherited all his titles. No issue.
 * Juan Claros Pérez de Guzmán, 11th Duke of Medina Sidonia (1642-1713), succeeded his half-brother in 1667.

In 1639, the Duke signed documents giving the considerable amount of 20,000 Ducados to his mistress Margarita Marañon Ybarra, on condition she became a nun near his palace in Sanlúcar de Barrameda, later in a Dominican convent. She was the mother of his illegitimate children :
 * Alfonso Pérez de Guzmán y Marañon (1637-1708), viceroy of Valencia.
 * Domingo de Guzmán y Marañon (pt), Archbishop of Evora
 * Francisco, Archdeacon and canon of Toledo.
 * Juana, a nun.