Artificial spin ice has been recently implemented in two-dimensional arrays of mesoscopic magnetic wires. We propose a theoretical model of magnetization dynamics in artificial spin ice under the action of an applied magnetic field. Magnetization reversal is mediated by domain walls carrying two units of magnetic charge. They are emitted by lattice junctions when the local field exceeds a critical value Hc required to pull apart magnetic charges of opposite sign. Positive feedback from Coulomb interactions between magnetic charges induces avalanches in magnetization reversal.