The city of Tarma is located in the center of the Tarma Province; 232 kilometers east of the city of Lima, in the mountain ranges of the Andes. Its location is the point of nexus between the central coast (departments of Lima and Ica), the Andean provinces of the department of Junín and the Central Forest (provinces of Chanchamayo and Satipo). The city is situated within a fertile valley, where many important civilizations lived in the past, from pre-Inca cultures to the Inca Culture. Evidence can be found through archaeological remains.
Recent archaeological excavations show that prior to Inca occupation, the gorges of Tarma were settled by many ethnic groups. The Chinchaycocha were to the northwest, mainly what is today Oroya and northern part of the valley. The xauxa settled to the southern part, south of Tarma river. A small group called Palcamayo settled to the east section. When the Inca arrived, they built up a new province in Tarma. They took away people and territory from the former ethnic groups and building a strategic political province, which allowed them to better control the large ethnic groups of Chinchaycocha, Xauxa and Wanka. Tarma became a sort of puffer zone for the Inca. The capital of the Inca province was Tarmatambo.
Tarma was founded during the policy of "reducciones" under the rule of fifth viceking Francisco de Toledo (1569-1575). The Spaniards moved the capital or head of the province from Tarmatambo, located at a slope of a mountain, to the bottom of the valley, called Pampas. Originally its name was Santa Ana de Pampas, and was a town of natural people, called "pueblo de indios".
With the introduction of the Intendencias in 1784, the first Intendente Don Juan Maria Gálvez, converted or elevated the status of the village to that of a "villa" or town. This meant that the Cabildo or city administration was no longer in the hand of the local indians, but turned to the Spaniards and wealthy mestizos. Thus, was also the name of the town change to Tarma. Indeed, throughout the Colonial time, since the 17th century, the name of Tarma was becoming popular in used than the one of Pampas. In 1815 the first cadastre was made in Tarma, concluding that the town had 775 houses and approximately 3500 inhabitants.
In the beginning of November, 1820, during the war of independence that took ahead general Don Jose of San Martín, the population of the city of Tarma supported the General Arenales. On the 25th of November, General Arenales reached Tarma, being welcomed with celebrations in the city.
On 31 December 1855, Tarma officially became a province.
During the War of the Pacific, Tarma supported the Peruvian army, and later supported the resistance commanded by Marshal Andrés Avelino Cáceres.