War of the Grand Alliance : A French warship commanded by Captain Pierre Le Moyne d'Iberville defeated an English squadron at the Battle of Hudson's Bay.

The Battle of Hudson's Bay, also known as the Battle of York Factory, was a naval battle fought during the War of the Grand Alliance (known in England's North American colonies as "King William's War"). The battle took place on 5 September 1697, when a French warship commanded by Captain Pierre Le Moyne d'Iberville defeated an English squadron commanded by Captain John Fletcher. As a result of this battle, the French took York Factory, a trading post of the Hudson's Bay Company.

The Nine Years' War (1688–1697), often called the War of the Grand Alliance or the War of the League of Augsburg, was a conflict between France and a European coalition which mainly included the Holy Roman Empire (led by the Habsburg Monarchy), the Dutch Republic, England, Spain, Savoy and Portugal. It was fought in Europe and the surrounding seas, in North America, and in India. It is sometimes considered the first global war. The conflict encompassed the Williamite war in Ireland and Jacobite risings in Scotland, where William III and James II struggled for control of England and Ireland, and a campaign in colonial North America between French and English settlers and their respective Native American allies.

Louis XIV of France had emerged from the Franco-Dutch War in 1678 as the most powerful monarch in Europe, an absolute ruler whose armies had won numerous military victories. Using a combination of aggression, annexation, and quasi-legal means, Louis XIV set about extending his gains to stabilize and strengthen France's frontiers, culminating in the brief War of the Reunions (1683–1684). The Truce of Ratisbon guaranteed France's new borders for twenty years, but Louis XIV's subsequent actions—notably his Edict of Fontainebleau (the revocation of the Edict of Nantes) in 1685—led to the deterioration of his political pre-eminence and raised concerns among European Protestant states. Louis XIV's decision to cross the Rhine in September 1688 was designed to extend his influence and pressure the Holy Roman Empire into accepting his territorial and dynastic claims. However, Holy Roman Emperor Leopold I and German princes resolved to resist. The States General of the Netherlands and William III brought the Dutch and English into the conflict against France and were soon joined by other states, which now meant the French king faced a powerful coalition aimed at curtailing his ambitions.

The main fighting took place around France's borders in the Spanish Netherlands, the Rhineland, the Duchy of Savoy, and Catalonia. The fighting generally favoured Louis XIV's armies, but by 1696 his country was in the grip of an economic crisis. The Maritime Powers (England and the Dutch Republic) were also financially exhausted, and when Savoy defected from the Alliance, all parties were keen to negotiate a settlement. By the terms of the Treaty of Ryswick, Louis XIV retained the whole of Alsace but in exchange had to return Lorraine to its ruler and give up any gains on the right bank of the Rhine. Louis XIV also recognized William III as the rightful king of England, while the Dutch acquired a barrier fortress system in the Spanish Netherlands to help secure their borders.

The peace would be short-lived. With the ailing and childless Charles II of Spain's death approaching, a new dispute over the inheritance of the Spanish Empire was soon to embroil Louis XIV and the Grand Alliance in the War of the Spanish Succession.