 The population was hostile and the Duke of Berwick was cutting off communications with Portugal and Aragon.The decision was made to abandon Madrid and to join the allied troops in Valencia.The Duke of Berwick was waiting for them and inflicted a crushing defeat in the Battle of Almansa.