Tunnel excavation unloading is the primary factor in disasters such as collapse and large deformations of surrounding rock. Therefore, it is a key issue to study the deformation mechanism of the surrounding rock in the process of tunnel excavation unloading. However, the original three-dimensional discontinuous deformation analysis method (3D DDA) can only simulate the displacement of the surrounding rock after the completion of tunnel excavation, which is not suitable for studying the mechanism of the surrounding rock’s deformation caused by tunnel excavation. Therefore, this paper proposes a virtual block removal algorithm that moves the blocks out of the calculation area while ensuring the consistency of the array and develops an improved 3D DDA method (3D DDA_exc) by embedding the algorithm into the original 3D DDA program, which is suitable for the simulation of tunnel excavation. In addition, based on the free fall models of static and sliding blocks, we compare the results of the 3D DDA_exc simulation with theoretical calculation results, which are basically the same. Then, both the 3D DDA_exc method and the discrete element method (DEM) are used to simulate the excavation of the tunnel in a blocky rock mass, and the rock displacements around the tunnel hole are basically the same, which further illustrates the accuracy of the 3D DDA_exc method in simulating tunnel excavation. Finally, taking the Huangjiazhuang Tunnel of the Rizhao-Lankao high-speed railway as a case study, we simulated block collapse during the excavation process of the tunnel using the centre diaphragm method (CD method). Compared with the result of the 3D DDA method without the process of tunnel excavation, block collapse can be avoided if the dangerous blocks are supported and reinforced during the excavation of part ① and part ② of the tunnel, which was of guiding significance to the safe construction of the tunnel.