At the time of the Restoration of the Portuguese monarchy in 1640, the new king John IV of Portugal nominated D. Rodrigo da Cunha to the position, but the order refused to ratify the king's choice, noting that the title was currently held by a Spanish "Infante". For the next few decades, the king and the order continued at odds, the order forwarding its own candidates against the king's choices. No one held the formal title of "prior", the king being limited to appointing an administrator or governor for the order. A compromise was finally reached during the regency of Peter II, whereby the king agreed to recognize the candidate nominated by the order, and in return, the king would get to nominate his three subsequent successors.