Habitat loss and fragmentation as a consequence of human activities is a worldwide phenomenon and one of the major threats to global biodiversity. Habitat loss and fragmentation is particularly a concern in the biodiverse tropics, where deforestation is occurring at unprecedented rates. Although insects are one of the most diverse and functionally important groups in tropical ecosystems, the quantitative effect of landscape features on their gene flow remains unknown. Here, we used a robust landscape genetics approach to quantify the effect of ten landscape features (deforestation, mature forests, other forest types, the River Chagres, streams, stream banks, roads, sea, lakes and swamps) and interactions between them, on the gene flow of a neotropical forest keystone species, the army ant Eciton burchellii. The influence of landscape on E. burchellii's gene flow reflected the different dispersal capability of its sexes; aerial for males and pedestrian for females, and the different depths of population history inferred from microsatellites and mitochondrial DNA. In contrast to the gene flow-facilitating effect of mature forests, deforested areas were found to be strong barriers for E. burchellii's gene flow. Other forest types were found to be gene flow facilitators but only when interacting with mature secondary forests, therefore indicating the importance of mature forests for the survival of E. burchelii and its associate species. The River Chagres was identified as a major historical gene flow barrier for E. burchellii, suggesting that an important loss of connectivity may occur because of large artificial waterways such as the Panama Canal.