  We study harmonic maps from degenerating Riemann surfaces with uniformly
bounded energy and show the so-called generalized energy identity. We find
conditions that are both necessary and sufficient for the compactness in
$W^{1,2}$ and $C^{0}$ modulo bubbles of sequences of such maps.
