  It is shown that electron injection into a laser-driven plasma bubble can be
manipulated by applying an external magnetic field in the presence of a plasma
density gradient. The down-ramp of the density-tailored plasma locally reduces
the plasma wave phase velocity, which triggers injection. The longitudinal
magnetic field dynamically induces an expanding hole in the electron density
distribution at the rear of the wake bubble, which reduces the peak electron
velocity in its vicinity. Electron injection is suppressed when the electron
velocity drops below the phase velocity, which depends on the size of the
density hole. This enables the start and end of electron injection to be
independently controlled, which allows generation of sub-femtosecond electron
bunches with peak currents of a few kilo-Ampere, for an applied magnetic field
of $\sim 10$ Tesla.
