In recent years, fractional differential equations have attracted much attention due to their wide application. In this paper, we present a novel numerical method for the space–time Riesz–Caputo fractional diffusion equation, which discrete the Riesz derivative by a fourth-order fractional-compact difference scheme, then the above space–time Riesz–Caputo fractional diffusion equation change into a fractional ordinary differential equation (FODE) system. Again using Laplace and inverse Laplace transforms, one can get the analytical solution of the FODE system, furthermore, we approximate the Mittag-Leffler function by the global Padé approximation and obtain the numerical method for the space–time Riesz–Caputo fractional diffusion equation. Finally, two numerical examples are presented to show that the numerical results are in good line with our theoretical analysis.