A model of electron acceleration by an electron Bernstein mode in a parabolic density profile is developed. The mode has a Gaussian profile. It could be excited via the mode conversion of an electromagnetic wave or by an electron beam. As it attains a large amplitude, it axially traps electrons moving close to its parallel phase velocity, where parallel refers to the direction of static magnetic field. As the electrons are accelerated and tend to get out of phase with the wave, the transverse field of the mode enhances its energy and relativistic mass, increasing the dephasing length. The scheme can produce electron energies up to a few MeV.