The city was established in the beginning of 18th century by a member of the Martins e Ramos family, from the city of Itu, who followed the Tietê River to this place in a valley between the three mountains Japi, Guaxatuba and Taguá. Sugar cane was planted in the area for distilled beverage production, which earned the city its nickname Terra da Pinga.
The landscape is dominated by the mountains (Japi, Guaxatuba and Taguá) and the Tietê river. The altitudes vary between 640 m in the center of the city up to 1,200 m Serra do Japi. The area of the city is 260km², of which 96km² are urban and 165km² are rural.
According to the 2000 IBGE Census, the population was 33,100, of which 25,760 are urban and 7,340 are rural. The life expectancy was 71.14 years. The literacy rate was 90.05%.