Purpose Hybrid navigation is a promising technique which combines the benefits of optical or electromagnetic tracking (EMT) and fluoroscopy imaging. Unfortunately, the fluoroscopy system is a source of metallic distortion for the EMT system. In this work, we present a new method for intraoperative calibration and real-time compensation of dynamic field distortions. The method was tested in the presence of a fluoroscopy C-arm, and sub-millimetre errors were obtained after distortion correction. Methods A hybrid navigation scenario was created by combining the open-source electromagnetic tracking system Anser EMT and a commercial fluoroscopy C-arm. The electromagnetic field generator was placed directly on top of the X-ray collimator, which introduced significant field distortion. Magnetic sensors were placed at known positions to capture the magnetic distortion, and virtual magnetic dipole sources were used to model the distortion magnetic field. The accuracy of the compensated EMT model was tested on a grid of test points. Results Error reduction was demonstrated from 12.01 to 0.35 mm and from 25.03 to 0.49 mm, for horizontal and vertical sensor orientations, respectively, over a volume of 16 x 16 x 6 cm. It is proposed that such sub-millimetre tracking errors meet the needs of most endoscopic navigation tasks. Conclusions We describe a method to model a magnetic field in real time, based on redundant electromagnetic field measurements, and we apply it to compensate for the distortion introduced by a fluoroscopy C-arm. The main limitation of the approach is the requirement for a high number of sensors, with possible occlusion of the operative space. Solutions might come from miniaturisation and wireless sensing.