William's reputation as a staunch Protestant enabled him and his wife to take power. During the early years of his reign, William was occupied abroad with the Nine Years' War (1688–97), leaving Mary to govern the kingdom alone. She died in 1694. In 1696, the Jacobites plotted unsuccessfully to assassinate William and return his father-in-law to the throne. William's lack of children and the death in 1700 of his nephew Prince William, Duke of Gloucester, the son of his sister-in-law Anne, threatened the Protestant succession. The danger was averted by placing distant relatives, the Protestant Hanoverians, in line to the throne with the Act of Settlement 1701. Upon his death in 1702, the king was succeeded in Britain by Anne and as titular Prince of Orange by his cousin, John William Friso.