  We show that both the maximum energy gain and the accelerated beam quality
can be efficiently controlled by the plasma density profile. Choosing a proper
density gradient one can uplift the dephasing limitation. When a periodic wake
field is exploited, the phase synchronism between the bunch of relativistic
particles and the plasma wave can be maintained over extended distances due to
the plasma density gradient. Putting electrons into the $n-$th wake period
behind the driving laser pulse, the maximum energy gain is increased by the
factor $2\pi n$ over that in the case of uniform plasma. The acceleration is
limited then by laser depletion rather than by dephasing. Further, we show that
the natural energy spread of the particle bunch acquired at the acceleration
stage can be effectively removed by a matched deceleration stage, where a
larger plasma density is used.
