The complex near trench velocity structures, characterized by strongly varying bathymetry along with seawater, can produce substantial waveform complexities for near trench earthquakes, which makes it difficult to study earthquake source parameters through waveform modeling/inversion. Here we explore these wavefield complexities via modeling teleseismic records of a Mw6.6 near coast event and a Mw6.8 near trench event in the 2015 Illapel earthquake sequence. For the near coast event, the waveforms of direct P waves at teleseismic/diffracted distances are simple, and we obtain consistent source parameters between 1D regional and teleseismic waveform inversions. In contrast, the near trench event produces stronger and longer P coda waves (>100 s), resulting in many dramatic discrepancies between the regional and teleseismic inversions, in particular for the centroid depth. We adopt a spectral element method-direct solution method hybrid approach to simulate synthetics with the complex source-side 3-D structures (bathymetry and water layer in this case) and investigate their roles in the genesis of strong P coda waves. Compared with the 1-and 2-D synthetics, the 3-D synthetics significantly improve the waveform fits up to 0.1 Hz when the source is placed at the preferred horizontal (~30 km from the trench axis) and vertical (~5 km beneath the ocean bottom) location. The refined location of the earthquake indicates that the plate interface is probably locked at very shallow depths and capable of nucleating strong earthquakes. We highlight the need for considering near trench 3-D structures in seismic waveform analysis of near trench earthquakes, many of which are tsunamigenic.Key Points:• The persisting (>100 s) and strong P coda waves of a Mw6.8 near trench event are well reproduced by the 3D modelling that incorporates bathymetry and water layer • 3D waveform modelling is used to relocate the centroid of the near trench earthquake to be 30 km away from the trench and 5 km beneath the ocean floor • Strong and long lasted coda waves of the 2015 Mw8.3 Illapel mainshock could be largely explained by the near trench structure effectsSupporting Information:• Supporting Information S1