Mary, born at St James’s Palace in London on 30 April 1662, was the eldest daughter of the Duke of York (the future King James II & VII), and his first wife, Anne Hyde. Mary’s uncle was King Charles II, who ruled the three kingdoms of England, Scotland and Ireland. She was baptised into the Anglican faith in the Chapel Royal at St James’s, and was named after her ancestor, Mary, Queen of Scots. Although her mother bore eight children, all except Mary and her younger sister Anne died very young, and King Charles II had no legitimate children. Consequently, for most of her childhood, Mary was second in line to the throne after her father.
The Duke of York converted to Roman Catholicism in 1668 or 1669 and the Duchess about eight years earlier, but Mary and Anne were brought up as Anglicans, pursuant to the command of Charles II. They were moved to their own establishment at Richmond Palace, where they were raised by their governess. Mary’s education, from private tutors, was largely restricted to music, dance, drawing, French, and religious instruction. Her mother died in 1671, and her father remarried in 1673, taking as his second wife Mary of Modena, a Catholic who was only four years older than Mary.
At the age of fifteen, Mary became betrothed to her cousin, the Protestant Stadtholder of Holland, William III of Orange. William was the son of the King’s late sister, Mary, Princess Royal, and thus fourth in the line of succession after James, Mary, and Anne. At first, Charles II opposed the alliance with the Dutch ruler—he preferred that Mary wed the heir to the French throne, the Dauphin Louis, thus allying his realms with Catholic France and strengthening the odds of an eventual Catholic successor in Britain; but later, under pressure from Parliament and with a coalition with the Catholic French no longer politically favourable, he approved the proposed union. The Duke of York agreed to the marriage, after pressure from chief minister Lord Danby and the King, who incorrectly assumed that it would improve James’s popularity among Protestants. When James told Mary that she was to marry her cousin, “she wept all that afternoon and all the following day”.
William and a tearful Mary were married in St James’s Palace by Bishop Henry Compton on 4 November 1677. Mary accompanied her husband on a rough sea crossing back to the Netherlands later that month, after a delay of two weeks caused by bad weather. Rotterdam was inaccessible because of ice, and they were forced to land at a small village, and walk through the frosty countryside until met by coaches to take them to Huis Honselaarsdijk. On 14 December, they made a formal entry to The Hague in a grand procession.
Mary’s animated and personable nature made her popular with the Dutch people, and her marriage to a Protestant prince was popular in Britain. She was devoted to her husband, but he was often away on campaigns, which led to Mary’s family supposing him to be cold and neglectful. Within months of the marriage Mary was pregnant; however, on a visit to her husband at the fortified city of Breda, she suffered a miscarriage, which may have permanently impaired her ability to have children. Her childlessness would be the greatest source of unhappiness in her life.