From that time on, Chile had complete control of the Pacific, which gave her rapid access to expand the war.  In 1879, Chile invaded the coastal Department of Tarapacá in southern Peru and a number of scattered Peruvian port cities along the desert coast.  On January 17, 1881, Chilean forces took Lima, the capital city.  The war continued until October 20, 1883, when the Treaty of Ancón put an end to it.