  Plasmoids -- magnetized quasi-circular structures formed self-consistently in
reconnecting current sheets -- were previously considered to be the graveyards
of energetic particles. In this paper, we demonstrate the important role of
plasmoids in shaping the particle energy spectrum in relativistic reconnection
(i.e., with upstream magnetization $\sigma_{\rm up} \gg 1$). Using two
dimensional particle-in-cell simulations in pair plasmas with $\sigma_{\rm
up}=10$ and $100$, we study a secondary particle energization process that
takes place inside compressing plasmoids. We demonstrate that plasmoids grow in
time, while their interiors compress, amplifying the internal magnetic field.
The magnetic field felt by particles injected in an isolated plasmoid increases
linearly with time, which leads to particle energization as a result of
magnetic moment conservation. For particles injected with a power-law
distribution function, this energization process acts in such a way that the
shape of the injected power law is conserved, while producing an additional
non-thermal tail $f(E)\propto E^{-3}$ at higher energies followed by an
exponential cutoff. The cutoff energy, which increases with time as $E_{\rm
cut}\propto\sqrt{t}$, can greatly exceed $\sigma_{\rm up} m_e c^2$. We
analytically predict the secondary acceleration timescale and the shape of the
emerging particle energy spectrum, which can be of major importance in certain
astrophysical systems, such as blazar jets.
