The electron acceleration mechanism associated with the generation of a plasma wave due to selfmodulation instability of laser radiation in a subcritical plasma produced by a laser prepulse coming 10 ns before the arrival of the main intense femtosecond pulse is considered. Three-dimensional particle-in-cell simulations of the interaction of laser radiation with two-dimensionally inhomogeneous subcritical plasma have shown that, for a sufficiently strong plasma inhomogeneity and a sharp front of the laser pulse, efficient plasma wave excitation, electron trapping, and generation of collimated electron beams with energies on the order of 0.2-0.5 МeV can occur. The simulation results agree with experiments on the generation of collimated beams of accelerated electrons from metal targets irradiated by intense femtosecond laser pulses.