We investigate the depinning transition in a dirty periodic medium considering a model of layered charge density waves as a prototype system. We find that depinning from strong disorder occurs via a two stage process, where, first, the pinned system experiences a continuous transition into a plastically sliding state and undergoes a second sharp hysteretic transition into a coherently moving 3D state at higher drives. In the weakly disordered system the depinning into a coherently sliding state remains continuous.Depinning of periodic structures such as charge density waves (CDW), vortex and domain wall lattices, and Wigner crystal from a random pinning potential under the influence of an external driving force is one of the paradigms of condensed matter physics. All these systems share one thing in common: many of elastically coupled degrees of freedom interacting with a quenched random environment. In this Letter we report analytic results on the nature of the depinning transition in dirty periodic media using CDW dynamics as a prototype model and discuss possible extensions to other systems.Two types of depinning have been observed: a smooth non-hysteretic transition with a unique pinning threshold, and transport switching characterized by an abrupt hysteretic transition into a sliding state [1], [2]. Smooth depinning described in terms of critical behavior [3] follows from the description of the above systems as classical field associated with the distortions of the system. Much of the switching behavior is explained by the possibility of plastic deformations allowing the amplitude of CDW to vanish along certain surfaces within the system [4,5]. Recent experimental and numerical studies [6][7][8][9] of vortex transport in HTS have demonstrated that the depinning of the vortex lattice can also be accompanied by plastic effects.These latter findings suggest that plastic effects can play an essential role in the depinning, and that the nonequilibrium steady state near the transition resembles fluid-like motion. On the contrary, at very high velocities well above the depinning transition the influence of disorder on the dynamics is suppressed and one can expect coherent motion of an almost perfect solid periodic system. A problem of separation of these two different driven regimes has been addressed in [9] in the context of vortex transport. It was proposed that the driven periodic medium subject to sufficiently strong disorder undergoes a sharp hysteretic dynamic transition from coherent motion with almost perfect structure to fluid-like plastic dynamics upon decreasing the drive at a second critical force F f force well above the pinning threshold F T . This was called dynamic freezing. Upon increasing the driving force from the pinned state the vortex lattice starts to slide at F = F T , this depinning being followed by the multiple plastic effects, and elastic motion recovers at F = F f > F T . This concept received strong support both from earlier observations of plastic effects [6] and from the subsequent ...