The disasters of the war (accompanied by another famine) were so great that France was on the verge of collapse by 1709. In desperation, the king appealed to the French people to save their country, and in doing so gained thousands of new army recruits. Afterwards, his general Marshal Villars managed to drive back the allied forces. In 1714, the war ended with the treaties of Utrecht and Rastadt. France did not lose any territory, and there was no discussion of returning Flanders or Alsace to the Habsburgs. While the Duke of Anjou was accepted as King Philip V of Spain, this was done under the condition that the French and Spanish thrones never be united. Finally, France agreed to stop supporting Jacobite pretenders to the English throne. Just after the war ended, Louis died, having ruled France for 72 years.