A method has been developed, for use in magnetic confinement devices, to measure the magnetic field vector B⃗ in plasmas or gases. It utilizes the intensities of the π and σ components of the resonance multiplet emitted by lithium atoms subjected to a strong Zeeman effect. A difference in dependence of these intensities on the inclination angle θ between B⃗ and the line of sight allows one to determine the direction of B⃗, provided the intensity ratio of the π and σ components ξ(θ) is measured. The magnitude of B⃗ is routinely inferred from the width of the multiplet. The principles of the measurement are elaborated in detail for the case of a fast Li beam (20–100 keV) used to diagnose a fusion plasma. The deviation of the population of the m states from the statistical one due to a dominant direction for the relative velocity during the excitation of the atoms by plasma ions has been analyzed and corrections to ξ(θ) are calculated. The geometry employed for the measurement is investigated in order to minimize the uncertainties due to systematic and random errors. A procedure for in situ calibration is outlined. As proof of the principle the results from poloidal magnetic field measurements in ohmic and H-mode pulses on the Joint European Torus are analyzed. As expected, much higher components of the poloidal magnetic field BZ and BR have been found at the plasma edge in H-mode pulses indicating the sensitivity of the measurements to the bootstrap current. An accuracy of 10–20% for the poloidal magnetic field component BZ and BR and 1% for B has been reached. Reasonable agreement has been observed between the expected and obtained accuracy. The uncertainty in - be;(θ) is found to be close to the statistical limit at ξ(θ)≫6%. The prospects for current density measurement at the plasma edge, which remains a key issue for achieving advanced performance of modern tokamaks, are examined in terms of making use of the developed technique. It is concluded that prospects are good provided the best available Li-beam guns, with equivalent neutral current ∼5 mA, are used. © 2004 American Institute of Physics.