A (m+3)-dimensional Einstein–Gauss–Bonnet gravitational model including the Gauss–Bonnet term and the cosmological term Λ is considered. Exact solutions with exponential time dependence of two scale factors, governed by two Hubble-like parameters H>0 and h≠H, corresponding to factor spaces of dimensions m>2 and l=2, respectively, are found. Under certain restrictions on x=h/H, the stability of the solutions in a class of cosmological solutions with diagonal metrics is proved. A subclass of solutions with small enough variation of the effective gravitational constant G is considered and the stability of all solutions from this subclass is shown. This article is part of the theme issue ‘The future of mathematical cosmology, Volume 1’.