The Spanish town of Miraflores was established in the 16th century. However it was merged into the Lima Metropolitan Area as the city expanded during the early 20th century. During the War of the Pacific (1879–1885), the district was the scene of the Battle of Miraflores. Two thousand people died as a result and the district was sacked and burned by Chilean invaders.