Chile is one of the most seismic countries in the world especially due to the subduction of the Nazca plate under the South America plate along the Chilean cost. Normally, the spatial distribution of seismic events tends to form spatial and temporal clusters around the main event including both precursor and aftershock events. However, it is very difficult to identify whether an event is a precursor, a main event or an aftershock. In the literature, only some large earthquakes are well described but it does not exist an automatic method to classify them. In this work, we propose a new density based clustering method, called ST-DBSCAN-EV (Space-time DBSCAN with Epsilon Variable), which allows the Epsilon parameter (the radius) to vary depending on the density of the points. The results of the ST-DBSCAN-EV are validated on three important earthquakes with magnitude greater than 8.0 Mw occurred in Chile in the last 20 years, by carrying out a series of experiments considering different combinations of parameters. A comparison with some traditional clustering techniques such as the DBSCAN, ST-DBSCAN, and the K-Means has been implemented for assessing the performance of the proposed method. Almost in all cases ST-DBSCAN-EV outperformed traditional ones by providing an F1-Score metric higher than 0.8. Finally, the results of classification are compared with a declustering method.