At that time the number of African slaves was drastically reduced and the city was developed, with modern drains, animal trams, train stations crossing the city, gas and electric lighting, telephone and telegraph wiring, water and river plumbing.
On 27 January 1763, the colonial administration in Portuguese America was moved from Salvador to Rio de Janeiro.
In 1840, the number of slaves reached 220,000 people.
The Port of Rio de Janeiro was the largest port of slaves in America.
The city remained primarily a colonial capital until 1808, when the Portuguese royal family and most of the associated Lisbon nobles, fleeing from Napoleon's invasion of Portugal, moved to Rio de Janeiro.
The kingdom's capital was transferred to the city, which, thus, became the only European capital outside of Europe.