Compensation for a field-perturbing element in a magnetic tracking system (10) for locating a probe (22) is achieved by creating a reaction field model while the field-perturbing element is in known positions. A magnetic field location sensor (26) is disposed between the field-perturbing element and magnetic field generators of the tracking system. Magnetic field readings from the location sensor and from a magnetic field sensor (46, 40, 42, 44) on the probe are taken while the field-perturbing element is present. The position of the field-perturbing element is estimated from the location sensor readings, and a predicted reaction field calculated from the reaction field model. A compensated measurement is obtained by subtracting the predicted reaction field from the field detected by the location sensor. The readings from the probe sensor are adjusted using the compensated measurement in order to calculate the true position of the probe.