In the reign of Juan II, the king's disputes with his son Carlos de Viana over the rights to succession damaged the practice of making pacts. In 1460, the Diputació del General mobilised the country in defence of the prince. In the Accord of Vilafranca (1461), Juan II accepted his son as heir and established a new system that was favourable to the institutions of the land. The death of the prince led Catalonia into war. The Generalitat attempted to garner international support and proclaimed Enrique of Castile, Pedro of Portugal and René of Provence as counts of Barcelona. The Capitulation of Pedralbes (1472) sealed Catalonia's surrender.