 By the terms of the Treaty of Ryswick (1697), Louis XIV retained the whole of Alsace, but he was forced to return Lorraine to its ruler and give up any gains on the right bank of the Rhine.Louis XIV also accepted William III as the rightful King of England, while the Dutch acquired their barrier fortress system in the Spanish Netherlands to help secure their own borders.However, with the ailing and childless Charles II of Spain approaching his end, a new conflict over the inheritance of the Spanish Empire would soon embroil Louis XIV and the Grand Alliance in a final war – the War of the Spanish Succession.