AbstractAimThe boundaries of species distributions are often shaped by natural barriers, such as mountains and rivers, but species distribution models usually fail to include these constraints. We tested several approaches that include barriers as explanatory variables in species distribution models.LocationAfrica and South America.Time periodCurrent.Major taxa studiedPrimates.MethodsWe modelled the ranges of pairs of species separated by a river, taking into account three explanatory components: the environment (ecosystems, topohydrography, climate and human pressure), the spatial structure shaped by history and population dynamics (using a trend‐surface approach) and rivers as naturals barriers to dispersal (using a binary cis–trans variable that describes both sides of the river). To assess how the addition of a spatial structure and the barrier could improve distribution models, we used a nested approach by comparing models based on: (a) the environment; (b) the environment and the spatial structure; and (c) the environment, the spatial structure and the river. These models were constructed using favourability functions.ResultsThere was a decreased occurrence of high‐favourability values on the opposite side of the rivers in models that included the spatial structure of distributions compared with models based on the environment alone. This decrease was more marked when the description of the spatial structure was made more flexible. However, model performance was significantly improved by the inclusion of cis–trans variables that identified areas on the opposite side as totally unfavourable.Main conclusionsThe performance of distribution models can be improved by the use of approaches that describe barriers. Although adding the location of geographical units in relationship to a river appears to be the most accurate way to define the presence of a barrier, defining this variable may be challenging. A suitable alternative is to analyse the spatial structure of distributions using a flexible approach.