For systems with charged chiral fermions, the imbalance of chirality in the presence of magnetic field generates an electric current---this is the chiral magnetic effect (CME). We study the dynamical real-time evolution of electromagnetic fields coupled by the anomaly to the chiral charge density and the CME current by solving the Maxwell-Chern-Simons equations. We find that the CME induces the inverse cascade of magnetic helicity toward the large distances, and that at late times this cascade b