In 1879, Peru entered the War of the Pacific which lasted until 1884. Bolivia invoked its alliance with Peru against Chile. The Peruvian Government tried to mediate the dispute by sending a diplomatic team to negotiate with the Chilean government, but the committee concluded that war was inevitable. Chile declared war on 5 April 1879. Almost five years of war ended with the loss of the department of Tarapacá and the provinces of Tacna and Arica, in the Atacama region. Two outstanding military leaders throughout the war were Francisco Bolognesi and Miguel Grau. Originally Chile committed to a referendum for the cities of Arica and Tacna to be held years later, to self determine their national affiliation. However, Chile refused to apply the Treaty, and neither of the countries could determine the statutory framework. After the War of the Pacific, an extraordinary effort of rebuilding began. The government started to initiate a number of social and economic reforms to recover from the damage of the war. Political stability was achieved only in the early 1900s.