Treaty of Ryswick
The 1697 Treaty of Ryswick returned the duchy to its rightful owner, who was a cousin-once-removed of Frederick Louis, Count Palatine Charles II of Kleeburg, who was also king of Sweden as Charles XI.