This paper describes a 3D electromagnetic tracking (EMT) system, based on quasi-static magnetic fields and a sub-millimeter 3D magnetometer, providing complete localization - both spatial and angular positions - during surgical procedures. By integrating miniaturized sensors into surgical tools, such as deep brain stimulation (DBS) electrodes, this tracking system offers complementary or alternative solutions for X-ray imaging. Each spatial position in the measurement volume (MV) is uniquely encoded by a vector of four magnetic field amplitudes using the multilateration principle. The orientation is derived from the three orthogonal components associated with this vector. The field generator (FG) was manufactured on printed circuit boards ensuring high reproducibility and accurate magnetic fields. Position localization was evaluated using a custom magnetic field camera placed at various positions in the MV while the orientation was evaluating using a stereotactic system used in DBS surgery. Finally, DBS implantations were simulated to conclude on the validity of the tracking system for DBS surgery. The system achieved spatial and angular errors of 1.72 mm and 0.89° within a MV of 15 × 15 × 15 cm3 located at 18 cm from the FG and an update rate of the position of 0.4 Hz. Better performances - mean spatial and angular errors of 0.87 mm and 0.52° - were achieved when simulating DBS implantations. With its large distance to the FG, this quasi-static EMT system is particularly well-suited for DBS surgery, offering regular feedback to neurosurgeons. The tracking system could also be adapted to other functional neurosurgeries.