The death of Mary weakened William's position and made it necessary to cultivate good relations with the princess. She was now treated with every honour and civility, and finally established with her own court at St James's Palace. At the same time William kept her in the background and refrained from appointing her regent during his absence. In March 1695 Marlborough was allowed to kiss the king's hands, and subsequently was made the duke of Gloucester's governor and restored to his employments. In return Anne gave her support to William's government, though about this time, in 1696--according to James, in consequence of the near prospect of the throne--she wrote to her father asking for his leave to wear the crown at William's death, and promising its restoration at a convenient opportunity.[7] The unfounded rumour that William contemplated settling the succession after his death on James's son, provided he were educated a Protestant in England, may possibly have alarmed her.[8] Meanwhile, since the birth of the duke of Gloucester, the princess had experienced six more miscarriages, and had given birth to two children who only survived a few hours, and the last maternal hope flickered out on the death of the young prince on the 29th of July 1700. Henceforth Anne signs herself in her letters to Lady Marlborough as "your poor unfortunate" as well as "faithful Morley." In default of her own issue, Anne's personal choice would probably have inclined at this time to her own family at St Germains, but the necessity of maintaining the Protestant succession caused the enactment of the Act of Settlement in 1701, and the substitution of the Hanoverian branch. She wore mourning for her father in 1701, and before his death James is said to have written to his daughter asking for her protection for his family; but the recognition of his son by Louis XIV. as king of England effectually prevented any good offices to which her feelings might have inclined her.
On the 8th of March 1702 Anne became, by King William's death, queen of Great Britain, being crowned on the 23rd of April. Her reign was destined to be one of the most brilliant in the annals of England. Splendid military triumphs crushed the hereditary national foe. The Act of Union with Scotland constituted one of the strongest foundations of the future empire. Art and literature found a fresh renascence.