We introduce and study a one dimensional model of classical planar spins interacting self-consistently through magnetic field. The spins and the magnetic field evolve in time according to the Hamiltonian dynamics which mimics that of a free electron laser. We show that by rescaling the energy due to magnetic field inhomogeneity, in equilibrium, this system can be mapped onto a model very similar to the paradigmatic globally coupled Hamiltonian mean-field (HMF) model. The system exhibits a continuous equilibrium phase transition from paramagnetic to ferromagnetic phase, however unlike HMF, we do not see any magnetized quasistationary states.