Upon the death of Charles II without legitimate issue in 1685, the Duke of York became King as James II in England and Ireland, and as James VII in Scotland. He had a controversial religious policy; his attempt to grant freedom of religion to non-
Anglicans was not well-received, as the technique he chose was to annul acts of Parliament by royal decree. Several Protestant politicians and noblemen entered into negotiations with Mary's husband as early as 1687. After James took the step of forcing Anglican clergymen to read the
Declaration of Indulgence—the proclamation granting religious liberty to dissenters—from their churches in May 1688, his popularity plunged. Alarm amongst Protestants increased when his wife,
Queen Mary, gave birth to a son—
James Francis Edward—in June 1688, for the son would, unlike Mary and Anne, be raised a Roman Catholic. Some charged that the boy was "supposititious", having been secretly smuggled in to Queen's room in a bed-warming pan as a substitute for her stillborn baby. Although there was no evidence to support the allegation, Mary publicly challenged the boy's legitimacy, sending a pointed list of questions to her sister, Anne, regarding the circumstances of the birth.
On
30 June, the
Immortal Seven secretly requested William—then in the Netherlands with Mary—to come to England with an army. At first, William was reluctant; he was jealous of his wife's position as the heiress to the English Crown and feared that she would become more powerful than he was. Mary, however, convinced her husband that she did not care for political power, telling him "she would be no more but his wife, and that she would do all that lay in her power to make him king for life".
William agreed to invade and issued a declaration which referred to James' new-born son as the "pretended Prince of Wales". He also gave a list of grievances of the English people and stated that his proposed expedition was for the sole purpose of having "a free and lawful Parliament assembled". The Dutch army finally landed on
5 November, having been turned back by a storm in October. The disaffected English Army and Navy went over to William, and English people's confidence in James stood so low that they did not attempt to save their King. On
11 December, the defeated King attempted to flee, but was intercepted. A second attempt at flight, on
23 December, was successful: James escaped to France where he lived in exile until his death.
Mary was upset by the circumstances surrounding the deposition of her father, but William ordered her to appear cheerful on their triumphant arrival in London. As a result she was criticised for appearing cold to her father's plight. James too wrote a diatribe against her criticising her disloyalty, an action which deeply affected the pious Mary.
In 1689, a
Convention Parliament summoned by the Prince of Orange assembled, and much discussion relating to the appropriate course of action ensued. William of Orange felt insecure about his position; he wished to reign as a King, rather than function as a mere consort of a Queen. The only precedent for a joint monarchy dated from the sixteenth century: when Queen
Mary I married the Spanish Prince
Philip, it was agreed that the latter would take the title of King. But Philip II remained King only during his wife's lifetime, and restrictions were placed on his power. William, however, demanded that he remain King even after his wife's death. Although some prominent statesmen proposed to make her the sole ruler, Mary, remaining loyal to her husband, refused.
On
13 February 1689, Parliament passed the
Declaration of Right, in which it deemed that James, by attempting to flee on
11 December 1688, had abdicated the government of the realm, and that the Throne had thereby become vacant. Parliament offered the Crown not to James's eldest son,
James Francis Edward (who would have been the
heir-apparent under normal circumstances), but to William and Mary as joint Sovereigns. It was, however, provided that "the sole and full exercise of the regal power be only in and executed by the said Prince of Orange in the names of the said Prince and Princess during their joint lives." The declaration was later extended to exclude not only James and his heirs from the throne, but all Catholics, since "it hath been found by experience that it is inconsistent with the safety and welfare of this Protestant kingdom to be governed by a papist prince".
The
Bishop of London, Henry Compton, crowned William and Mary together at
Westminster Abbey on
11 April 1689. Normally, the
Archbishop of Canterbury performs coronations, but the Archbishop at the time,
William Sancroft, although an
Anglican, refused to recognise the validity of James II's removal. On the day of the coronation, the Convention of the
Estates of Scotland — which was much more divided than the English Parliament — finally declared that James was no longer King of Scotland. William and Mary were offered the separate Scottish Crown (the two kingdoms were not united until the
Acts of Union in 1707); they accepted on
11 May.
Even after the declaration, there was still substantial support for James in Scotland. The
Viscount of Dundee raised an army, and won a convincing victory at
Killiecrankie on
27 July. The huge losses suffered by Dundee's troops, coupled with his fatal wounding at the start of the battle, served to remove the only effective resistance to William and the uprising was quickly crushed, suffering a resounding defeat the next month at the
Battle of Dunkeld.