Heliconius butterflies are a famous example of adaptive radiation driven by natural selection on wing-pattern mimicry. Among them is Heliconius numata, which shows a spectacular polymorphism with multiple coexisting forms mimicking distinct local butterfly species and their geographic variations. Wing-pattern polymorphism is controlled by a group of tightly-linked genetic elements, or supergene, maintained in linkage disequilibrium by polymorphic chromosomal rearrangements. Each arrangement is characterised by one or several inversions, associated with a given phenotypic form. Here we investigate the origin of inversion polymorphism and the role of introgression in the formation of the supergene. Breakpoint genotyping in related species shows that the main inversion is shared with a non-sister species, H. pardalinus, suggesting introgression may explain the emergence of a new allelic class in H. numata. Based on whole genome resequence data, f and D statistics (ABBA-BABA analyses) reveal an excess of shared derived mutations in the inversion between H. numata and H. pardalinus. Treemix analyses indicate a history of gene flow between the two taxa, and topological changes in the phylogeny across the genome show a pattern of haplotype sharing consistent with an ancient introgression of the inversion into H. numata. Multiple sequentially Markovian coalescent (MSMC) analyses corroborate this ancient origin, while the population branching statistic (PBS) and haplotype similarity confirm the common origin of the inversion. Finally, comparative demographic inferences and Approximate Bayesian Computation (ABC) simulations lead to the hypothesis that supergene formation and polymorphism could be associated with an increase in effective population size and gene flow in H. numata. We conclude that the introgression of an inversion kick-started the evolution of the supergene and enabled distinct adaptive morphologies to coexist. Contrary to well-known cases where mimicry shifts cause speciation, here inversion polymorphism and demographic events may favour the maintenance of intraspecific diversity and inhibit cladogenesis.