[citation needed] It was historically one of the main locations in Chile where guano deposits could be found.
It was discovered by Alexander Von Humboldt, a German naturalist who studied the flora and fauna of South America.
Between 1845 and 1851 Huanillos was discovered by a Peruvian engineer who was sent by the government, until 1879 the border between Peru and Bolivia was located near the Bolivian city of Antofagasta, Chile took over this territory after the Pacific War.
The extraction of guano was approved by the Peruvian government in 1874, and with that the creation of the new village called Huanillos.
However, the Chinese people, especially men, were treated so badly that a large number of them committed suicide and the few who survived were rescued by Patricio Lynch, a Chilean military officer who fought in the War of the Pacific.