After the death of Queen Maria I in March 1816, the reign of King John VI began, and it remained in Brazil until 1821, when political circumstances made him return to Lisbon with the Royal Family, except for his eldest son Prince Pedro de Alcântara of Braganza (future Emperor of Brazil), who came to proclaim the independence of Brazil in 1822. Here also remained the Royal Library. At that time it had grown a lot and, after Independence, in 1822, became property of the Empire of Brazil, because its purchase is included in the Additional Convention to the Treaty of Friendship and Alliance signed between Brazil and Portugal on 29 August 1825. For the goods left in Brazil the Royal Family was indemnified in two million pounds sterling, of that value, eight hundred contos de reis were destined to the payment of the Royal Library, which was then called the Imperial and Public Library of the Court.
