After the War and the outbreak of the Liberal Triennium in 1820, he replaced his brother-in-law José Gabriel de Silva-Bazán y Waldstein as Director of the Prado Museum until 1823, when he had to take refuge in Italy after the French invaded the country.