Chile gained independence from Spain in 1810, and it's northern border was defined near the city of Taltal. When Peru gained independence 1821 it's southern border was near the present city of Tocopilla (meaning that Arica and Iquique were also within Peru's boundaries). Further to the South, the territory of Antofagasta gained independence with Bolivia in 1825.

map from A History of Chile, 1808-2002 by Simon Collier and Willaim F. Slater (p 130)

The border between Bolivia and Chile ran through the Atacama Desert, and was somewhat undefined, because neither country had much vested interest there. However, the natural fertilizer, sodium nitrate (salitre), was discovered in the desert in the 1830s, and attracted many foreign investors to the area. Nearby, Iquique-still a part of Peru-grew as a cultural and financial center because of increased mining business. The city was one of the first in the region to have electricity in homes and businesses. The Teatro Municiapal (Municipal Theater) of Iquique was built to showcase plays and musical acts. A railway station was built by John Thomas North, and Englishman known as the “King of Nitrate."

But this attention and growth caused some diplomatic tensions. With the nitrate boom, both Chile and Bolivia took an interest in the wealth they could acquire from this area and attempted to re-negotiate the border. In 1874 President Tomás Frías Ametller of Bolivia and Frederico Errázuriz Zañartu of Chile agreed that the border would be set at 24° S. Bolivia would retain the area around Antofagasta, but would not tax the Chilean company that was already operating in the area. This arrangement worked for a short time, but when the Hilarión Daza became president of Bolivia in 1876, he began heavily taxing the Chilean company.

Angry over the breached agreement, the media and popular sectors called for the newly elected Chilean president Aníbal Pinto to take the territory. He ordered the army to seize Antofagasta in February 1879. Bolivians suggest this was successful because most of their armed forces were celebrating Carnaval at the time. After two weeks of Chilean occupation of Antofagasta, Bolivia declared war. Because of a “secret” treaty signed in 1873 (meaning it was not publicized, but most politicians in the region knew of it), Peru was obligated to come to Bolivia’s aid. At first, Peruvian president Manuel Prado tried to mediate, but the general population of Chile protested, calling for further action and persuaded the president to declare was on both Bolivia and Peru in April 1879.

Hoping to create a buffer zone so that Bolivia would not be able to inch into Chilean territory again, the Chilean Navy set out to control maritime access further north. They blockaded Iquique then continued further North to Callao. By 1880, Chilean forces were trying to capture Arica, another strategic port north of Iquique and eventually were successful. Eventually, the Chilean Navy made it all the way north to Lima in January 1881, where they demanded the cession of the Peruvian regions Tarapacá, Arica, and Tacna, but Peruvian president Nicolás Piérola did not cede. Peru was still occupied in July 1882 when they won the battle of La Concepción, causing public sentiment in Chile to change. Finally, Chilean government proposed to occupy Tacna and Arica for ten years and retain Tarapacá indefinitely. In 1884 Chile signed an “indefinite truce” with Bolivia, granting them only temporary occupation of the Bolivian coastline. Yet, this area still remains under Chilean control, as do Arica, and Iquique (despite current Bolivian president Evo Morales’s appeals to the United Nations).