Microelectrode recording (MER) along surgical trajectories is commonly applied for refinement of the target location during deep brain stimulation (DBS) surgery. In this study, we utilize automatically detected MER features in order to locate the subthalamic nucleus (STN) employing an unsupervised algorithm. The automated algorithm makes use of background noise level, compound firing rate and power spectral density along the trajectory and applies a threshold-based method to detect the dorsal and the ventral borders of the STN. Depending on the combination of measures used for detection of the borders, the algorithm allocates confidence levels for the annotation made (i.e. high, medium and low). The algorithm has been applied to 258 trajectories obtained from 84 STN DBS implantations. MERs used in this study have not been pre-selected or pre-processed and include all the viable measurements made. Out of 258 trajectories, 239 trajectories were annotated by the surgical team as containing the STN versus 238 trajectories by the automated algorithm. The agreement level between the automatic annotations and the surgical annotations is 88%. Taking the surgical annotations as the golden standard, across all trajectories, the algorithm made true positive annotations in 231 trajectories, true negative annotations in 12 trajectories, false positive annotations in 7 trajectories and false negative annotations in 8 trajectories. We conclude that our algorithm is accurate and reliable in automatically identifying the STN and locating the dorsal and ventral borders of the nucleus, and in a near future could be implemented for on-line intra-operative use.