This paper devoted to the obtaining the explicit solution of $n$-dimensional wave equation with Gerasimov–Caputo fractional derivative in the infinite domain with non-zero initial condition and vanishing condition at infinity. It is shown that this equation can be derived from the classical homogeneous hyperbolic integro-differential equation with memory in which the kernel is $t^{1-\alpha}E_{2-\alpha, 2-\alpha}(-t^{2-\alpha}), \ \alpha\in(1, 2),$ where $E_{\alpha, \beta}$ is the Mittag-Liffler function. Based on Laplace and Fourier transforms the properties of the Fox H-function and convolution theorem, explicit solution for the solution of the considered problem is obtained.