 Meanwhile, the Portuguese garrisons in Extremadura successfully resisted a Castilian siege.Peace negotiations were restarted in the summer, and an agreement was reached.The treaty that put an end to the war was signed in the Portuguese city of Alcáçovas (today in Viana do Alentejo) on September 4, 1479.