Ultrashort-bunch, low-emittance electron beams are essential to reveal the hidden dynamics of intricate molecular and atomic processes in materials through experimentation such as time-resolved pulse radiolysis or time-resolved electron diffraction. The transverse and longitudinal dynamics of ultrashort electron beam in a photocathode linear accelerator were studied for femtosecond electron beam generation. The growths of the emittance, bunch length and energy spread due to the rf and the space charge effects in the rf gun were investigated by changing the laser injection phase. The dependences of the emittance, bunch length and energy spread on the booster linac rf phase were measured. Finally, a 100 fs electron source based on the photocathode rf gun with a femtosecond laser injection is proposed for time-resolved pulse radiolysis and time- resolved electron diffraction. The femtosecond beam dynamics in the rf gun was investigated by simulation.