Results of a relativistic three-dimensional single particle code, on direct laser acceleration of electrons in an axial static field are presented. The electron rotates around the propagation direction of the laser pulse during the interaction with circularly polarized intense laser pulse. Betatron resonance occurs between the electrons and electric field of the laser pulse for two optimum values of the magnetic fields, and the electrons gain much higher energies. The resonance is stronger at higher values of the magnetic field. The values of magnetic fields at which resonance occurs depend upon the laser intensity and plasma density, and initial electron energy. At higher plasma density, the group velocity of the laser pulse is too slow to catch up with the accelerated electrons, reducing the duration of interaction and diminishing energy gain. The electrons with less initial energy find more time to interact with the laser pulse and gain more energy than the electrons with more initial energy. Electron trajectory and energy for different parameters have been obtained. (C) 2004 American Institute of Physics.