In 1344 Peter IV of Aragon annexed the Kingdom of Majorca and Perpignan once more became part of the County of Barcelona. A few years later it lost approximately half of its population to the Black Death. It was attacked and occupied by Louis XI of France in 1463; a violent uprising against French rule in 1473 was harshly put down after a long siege, but in 1493 Charles VIII of France, wishing to conciliate Castile in order to free himself to invade Italy, restored it to Ferdinand II of Aragon.