The loss of Brazil and the conversion of the government of Portugal into a limited monarchy, enraged the nobility, and still more the clergy, who looked with horror on the radical reforms of the constituent assembly, and when the French invaded Spain in 1823 to suppress the rebellion in that country, General Francisco de Silveira, Count of Amarante, raised a "pronunciamento" in the Tras-os-Montes against the Constitution of 1822. John VI. had imbibed some of his elder son's ideas, and was in favour of modifying the absolute character of the Portuguese monarchy, but he never concealed his opinion that the radical party had gone too far in its extreme reforms. He therefore took advantage of the "pronunciamento" in the north to declare the Constitution of 1822 abrogated, and appointed the Count of Palmella prime minister, with instructions to form a "junta," and to draw up a moderate and well-balanced parliamentary constitution on the English model. But the absolutist party, headed by the queen and Dom Miguel, who had been appointed commander-in-chief of the army, would not tolerate any form of constitutional monarchy; they raised an insurrection in Lisbon against John VI.; the king's greatest friend, the liberal-minded Marquis of Loulé, was assassinated; Palmella and his colleagues were imprisoned; and the king himself was shut up in his palace and eventually fled for refuge on board an English man-of-war in the Tagus. The united action of the foreign ambassadors and ministers accredited to Portugal, led by Sir William A'Court, afterwards Lord Heytesbury, the representative of England, secured the restoration of the king's authority; the insurrection was suppressed; Dom Miguel was banished; Palmella was re-appointed prime minister; and at the close of 1824, the king returned to Brazil to spend his last days in peace. On reaching Rio de Janeiro, he recognized Dom Pedro as Emperor of Brazil, and on the 6th of March, 1826, John VI. died in the country of his choice. By his will, John VI. left the regency of Portugal to his daughter Isabel Maria, to the disgust of Dom Miguel, who had fully expected in spite of his conduct that Portugal would be in some manner bequeathed to him, and that Dom Pedro would be satisfied with the government of Brazil.