Answer
The answer is the **8th Duke of Braganza**. John IV was the Duke of Braganza before he became the King of Portugal. He was the head of the House of Braganza, a powerful noble family in Portugal. When the Portuguese throne became vacant in 1640, John IV was proclaimed king by a group of nobles and military officers who opposed the rule of the Spanish Habsburgs.