The first Jesuit reduction to convert and "civilize" the Indigenous population was founded in 1609, but some areas were occupied by Brazilians as Bandeirantes gradually extended their activities throughout much of the basin and adjoining Matto Grosso in the 17th and 18th centuries. These groups had the advantage of remote geography and river access from the mouth of the Amazon (which was in Portuguese territory) making it impossible for the Spanish authorities to control them. One famous attack upon a Spanish mission in 1628 resulted in the enslavement of 60 000 indigenous people. In fact as time passed they were used as a self funding occupation force by the Portuguese authorities in what was effectively a low level war of territorial conquest. Finally the reality of the situation was recognized with the transfer of sovereignty over the much of the basin and surrounding areas to Portugal in the 1750 Treaty of Madrid.