An MS 6.8 earthquake struck the Luding county in the southeastern section of the Xianshuihe fault on 5 September 2022, causing heavy casualties and serious property losses. Using the data of 61 seismic stations surrounding the focal area, we utilize the machine learning-based LOC-FLOW for phase picking and association, and obtain a total of 13,496 aftershocks. We also collate 2,331 preshocks near the mainshock. We then conduct event relocation and three-dimensional P- and S-wave velocity structure inversion by double-difference tomography. The catalog we obtained has higher accuracy and completeness than the manual catalog. The relocation results show that the mainshock struck the Moxi section of the Xianshuihe fault at 9.2 km depth. There is a southeast-striking seismic strip of 35 km long at 5–13 km depth, and two relatively shallow seismic clusters exist to the west and northwest of the mainshock. Furthermore, there is an obvious seismic gap to the northwest of the mainshock. Based on the spatial pattern of the aftershock sequence, we speculate that the Moxi section of the Xianshuihe fault is the seismogenic fault. The earthquakes are mainly located in the regions of low velocity and low Poisson’s ratio, which is consistent with the granite that is geologically distributed along the southeast section of the Xianshuihe fault. There are two high-velocity zones located to the northwest and southeast of the mainshock, which are speculated to have controlled the rupture scale of the MS 6.8 Luding earthquake.