Later on , Brazil would be elevated from the rank of a colony to that of a Kingdom , the Kingdom of Brazil , with the consequential formation of the United Kingdom of Portugal , Brazil and the Algarves .
This led to the formation of the United Kingdom of Portugal , Brazil and the Algarves .