We study a $$D$$-dimensional Einstein–Gauss–Bonnet gravitational model including the Gauss-Bonnet term and the cosmological constant $$\Lambda$$. We find a class of cosmological type solutions with exponential dependence of two scale factors on the variable $$u$$ (either cosmological time or a spatial coordinate), governed by two Hubble-like parameters $$H\neq 0$$ and $$h$$, corresponding to factor spaces of dimensions $$m>2$$ and $$l>2$$, respectively, and depending on the sign parameter $$\varepsilon=\pm 1$$ ($$\varepsilon=1$$ corresponds to cosmological solutions and $$\varepsilon=-1$$ to static ones). These solutions are governed by a certain master equation $$\Lambda\alpha=\lambda(x)$$ and the restriction $$\alpha\varepsilon(x-x_{+})(x-x_{-})<0$$ ($$x_{-}<0$$) for the ratio $$h/H=x$$, where $$\alpha=\alpha_{2}/\alpha_{1}$$ is the ratio of two constants of the model . The master equation is equivalent to a polynomial equation of either fourth or third order and may be solved in radicals. Imposing certain restrictions on $$x$$, and we prove the stability of the solutions for $$u\to\pm\infty$$ in a certain class of cosmological solutions with diagonal metrics.