In the post-pandemic period, influenza A(H1N1)pdm09 virus has been detected in swine populations in different parts of the world. This study was conducted to determine the presence and spatial patterns of this human pandemic virus among Nigerian pigs and identify associated risk factors. Using a two-stage stratified random sampling method, nasal swab specimens were obtained from pigs in Ibadan, Nigeria during the 2013–2014 and 2014–2015 influenza seasons, and the virus was detected by reverse transcriptase-polymerase chain reaction (RT-PCR). Purified RT-PCR products were sequenced in both directions, and sequences were aligned using MUSCLE. Phylogenetic analysis was conducted in MEGA6. Purely spatial scan statistics and a spatial lag regression model were used to identify spatial clusters and associated risk factors. The virus was detected in both seasons, with an overall prevalence of 8·7%. Phylogenetic analyses revealed that the M genes were similar to those of pandemic strains which circulated in humans prior to and during the study. Cluster analysis revealed a significant primary spatial cluster (RR = 4·71, LLR = 5·66, P = 0·0046), while ‘hours spent with pigs (R2 = 0·90, P = 0·0018)’ and ‘hours spent with pigs from different farms (R2 = 0·91, P = 0·0001)’ were identified as significant risk factors (P < 0·05). These findings reveal that there is considerable risk of transmission of the pandemic virus, either directly from pig handlers or through fomites, to swine herds in Ibadan, Nigeria. Active circulation of the virus among Nigerian pigs could enhance its reassortment with endemic swine influenza viruses. Campaigns for adoption of biosecurity measures in West African piggeries and abattoirs should be introduced and sustained in order to prevent the emergence of a new influenza epicentre in the sub-region.