The area around Huamachuco has been inhabited by one group of nomadic people or another dating back to before the time of Christ. One of the first civilizations to permanently flourish here was the Wamachuco culture, around the years of 1000-1400 a.d. They practiced a polytheistic religion, placing much importance on multiple gods and ancestors. The Wamachuco culture would eventually become entwined with the Incan culture as the latter made its way north from Cusco. Though the area around Huamachuco became a part of the Incan empire, many cultural and religious practices were retained from the time of the Wamachuko.

The 1500s brought the arrival of the Spaniards, and with them the Augustin priests, who had a major role in bringing Christianity to the area. Huamachoco, as with the rest of Peru, became a part of the Spanish Empire in South America. The city was an important stop along the routes inland over the Andes from the major cities on the coast. It was especially important as a link between the two cities of Trujillo and Cajamarca.

Huamachuco, and Peru, gained independence from Spain in the 1820s. The liberating armies of Simon Bolivar passed through the town during one of their campaigns. With Bolivar was one of his generals, Sanchez Carrion, whose name would later be adopted by the Province.

Later in the 19th century, Huamachuco played an important role during the 1883 war with Chile. An important battle was fought (and ultimitely lost) by Peruvian forces just outside of town.

Today, Huamachuco remains an important stop along the route between Trujillo and Cajamarca, two of the most important cities in northern Peru. Huamachuco is the seat of the Sancez Carrion province.