Dynamics of plasma confinement was considered in the experiments on ECR plasma heating in the L-2M stellarator. It was ascertained that four stages can be distinguished in the process of plasma heating and further cooling. In each stage, plasma confinement has its own distinctive features. In the first stage, plasma confinement is determined by radiation loss. In the second stage, the self-consistent profiles of electron temperature and density form in plasma and the quasi-stationary confinement mode ensues. After ECRH switching off, the third stage begins. The plasma starts cooling and its parameters change in accordance with the scaling of the L-2M stellarator, the self-consistent electron temperature and density profiles being maintained. After the plasma periphery becomes cooled, the fourth stage of plasma confinement starts, and radiation loss becomes a determinative factor again. © 2018 Institute of Physics Publishing. All rights reserved.