While motorways are often assumed to influence the movement behaviour of large mammals, there are surprisingly few studies that show an influence of these linear structures on the genetic make-up of wild ungulate populations. Here, we analyse the spatial genetic structure of red deer (Cervus elaphus) and wild boars (Sus scrofa) along a stretch of motorway in the Walloon part of Belgium. Altogether, 876 red deer were genotyped at 13 microsatellite loci, and 325 wild boars at 14 loci. In the case of the red deer, different genetic clustering tools identified two genetic subpopulations whose borders matched the motorway well. Conversely, no genetic structure was identified in the case of the wild boar. Analysis of isolation-by-distance patterns of pairs of individuals on the same side and on different sides of the motorway also suggested that the road was a barrier to red deer, but not to wild boar movement. While telemetry studies seem to confirm that red deer are more affected by motorways than wild boar, the red deer sample size was also much larger than that of the wild boars. We therefore repeated the analysis of genetic structure in the red deer with randomly sub-sampled data sets of decreasing size. The power to detect the genetic structure using clustering methods decreased with decreasing sample size.