Until the nineteenth century, Brazil was almost entirely a Roman Catholic country. John Calvin himself sent missionaries to Rio de Janeiro in the sixteenth century, and the Dutch Reformed Church followed when the Netherlands occupied a great part of the Brazilian northeast in the seventeenth century. However, despite these isolated episodes, from 1500 to 1800 there was almost no Protestantism in Brazil. This started to change early in the nineteenth century. In 1808, the Portuguese royal family fled to Rio de Janeiro, running away from Napoleon. In 1822, Brazil claimed its independence from Portugal. The constitution that ruled Brazil from 1824 to 1889 was at least partially liberal: although it maintained Roman Catholicism as the country’s official religion, it granted religious freedom to non-Catholics. Protestant immigrants started to arrive already in the 1820s, and Protestant missionaries began planting Brazilian churches in the 1850s and 1860s.