||In this paper, we develop an efficient spectral Galerkin method for the three dimensional (3D) multi-term time-space fractional diffusion equation. Based on the L2-1σ formula for time stepping and the Legendre-Galerkin spectral method for space discretization, a fully discrete numerical scheme is constructed and the stability and convergence analyses are rigorously established. The results show that
the fully discrete scheme is unconditionally stable and has second-order accuracy in time and optimal error estimation in space. In addition, we give the detailed implementation and apply the alternating-direction implicit (ADI) method to reduce the computational complexity. Furthermore, numerical experiments are presented to confirm the theoretical claims. As an application of the proposed method, the fractional Bloch-Torrey model is also solved.