Battles were fought in the Pacific Ocean, the Atacama Desert, the Peruvian deserts, and the mountainous regions in the Andes. For the first five months, the war played out in a naval campaign, as Chile struggled to establish a marine resupply corridor for its forces in the world's driest desert. Afterwards, Chile's land campaign bested the Bolivian and Peruvian armies. Bolivia withdrew after the Battle of Tacna, on May 26, 1880. Chile's forces occupied Lima in January 1881. Remnants and irregulars of the Peruvian army waged a guerrilla war but could not prevent war-weary Peruvian factions from reaching a peace deal with Chile involving territorial concessions.