 In March 1686, the French sent a raiding party under Chevalier des Troyes over to capture the company's posts along James Bay.In 1697, Pierre Le Moyne d'Iberville, commander of the company's captured posts, defeated three ships of the Royal Navy in the Battle of the Bay on his way to capture York Factory by a ruse.York Factory changed hands several times in the next decade and was finally ceded permanently in the 1713 Treaty of Utrecht.