The Xerces Blue (Glaucopsyche xerces) is considered to be the first butterfly to become extinct at global scale in historical times. It was notable for its chalky lavender wings with conspicuous white spots on the ventral wings. The last individuals were collected in their restricted habitat, in the dunes near the Presidio military base in San Francisco, in 1941. To explore the demographic history of this iconic butterfly and to better understand why it went extinct, we sequenced at medium coverage the genomes of four 80 to 100-year-old Xerces Blue specimens and seven historic specimens of its closest relative, the Silvery Blue (G. lygdamus). We compared these to a novel annotated genome of the Green-Underside Blue (G. alexis). Phylogenetic relationships inferred from complete mitochondrial genomes indicate that Xerces Blue was a distinct species that diverged from the Silvery Blue lineage at least 850,000 years ago. Using nuclear genomes, we show that both species experienced population growth during the MIS 7 interglacial period, but the Xerces Blue decreased to a very low effective population size subsequently, a trend opposite to that observed in the Silvery Blue. Runs of homozygosity in the Xerces Blue were significantly greater than in the Silvery Blue, suggesting a higher incidence of inbreeding. In addition, the Xerces Blue carried a higher proportion of derived, putatively deleterious amino acid-changing alleles than the Silvery Blue. These results demonstrate that the Xerces Blue experienced more than 100 thousand years of population decline, prior to its human-induced final extinction.