In her will, Mary asked the King to take care of the interests of her 10-year-old son, whose sole guardian was now his grandmother Amalia. In 1672, after several years of confrontation with republican leaders in the Netherlands, 21-year-old William was nevertheless elected stadtholder of five provinces, starting with Holland on 4 July, and named commander-in-chief. Five years later, he married his cousin Mary, the daughter of James II and Anne Hyde. In 1688, with the support of English Protestants, William deposed Mary's father and with his wife was proclaimed co-ruler of England, Scotland, and Ireland.