Substantial improvements in spatial resolution in brain positron emission tomography (PET) scanners have greatly reduced partial volume effect, making head movement the main source of image blur. To achieve high-resolution PET neuroimaging, precise real-time estimation of both head position and orientation is essential for accurate motion compensation. A high-resolution electromagnetic motion tracking (EMMT) system with an event-by-event motion correction is developed for PET-CTscanners. EMMT is comprised of a source, an array of sensors, and a readout electronic unit (REU). The source acts as a transmitter and emits an EM dipole field. It is placed in close proximity to the sensor array and detects changes in EM flux density due to sensor movement. The REU digitizes signals from each sensor and captures precise rotational and translational movements in real time. Tracked motion in the EMMT coordinate system is synchronized with the PET list-mode data and transformed into the scanner coordinate system by locating paired positions in both systems. The optimal rigid motion is estimated using singular value decomposition. The rigid motion and depth-of-interaction (DOI) parallax effect are corrected by event-by-event rebinning of mispositioned lines-of-response (LORs). We integrated the EMMT with our recently developed ultra-high resolution Prism-PET prototype brain scanner and a commercial Siemens Biograph mCT PET-CT scanner. We assessed the imaging performance of the Prism-PET/EMMT system using multi-frame motion of point sources and phantoms. The mCT/EMMT system was validated using a set of point sources attached to both a mannequin head and a human volunteer, for simulating multiframe and continuous motions, respectively. Additionally, a human subject for [18F]MK6240 PET imaging wasincluded. The tracking accuracy of the Prism-PET/EMMT system was quantified as a root-mean-square (RMS) error of 0.49 for 100 axial rotations, and an RMS error of 0.15 mm for 100 mm translations.The percent difference (%diff) in average full width at half maximum (FWHM) of point source between motion-corrected and static images, within a motion range of and 10 mm from the center of the scanner's field-of-view (FOV), was 3.9%. The measured recovery coefficients of the 2.5-mm diameter sphere in the activity-filled partial volume correction phantom were 23.9%, 70.8%, and 74.0% for the phantom with multi-frame motion, with motion and motion compensation, and without motion, respectively. In the mCT/EMMT system, the %diff in average FWHM of point sources between motion-corrected and static images, within a motion range of and 10 mm from the center of the FOV, was 14%. Applying motion correction to the [18F]MK6240 PET imaging reduced the motion-induced spill-in artifact in the lateral ventricle region, lowering its standardized uptake value ratio (SUVR) from 0.70 to 0.34. The proposed EMMT system is a cost-effective, high frame-rate, and none-line-of-sight alternative to infrared camera-based tracking systems and is capable of achieving high rotational and translational tracking accuracies for mitigating motion-induced blur in high-resolution brain dedicated PETscanners.