As Duke of York he was Lord High Admiral in the second and third Anglo-Dutch Wars, during which the Dutch settlement of New Amsterdam was captured and renamed New York in his honour (1664). He became a Roman Catholic and married Mary of Modena, also a Roman Catholic, in 1673, resigning as admiral in that year under the Test Act; attempts were made to exclude him from the succession during the years 1679–81, but on the death of Charles II he ascended the throne without opposition. Monmouth’s rebellion came early in his reign, and the Bloody Assizes that punished it were resented. Within three years of his accession he had provoked the widespread opposition that culminated in the Glorious Revolution, which replaced him on the throne by William and Mary. He died in exile in France.