  Young massive stellar clusters are extreme environments and potentially
provide the means for efficient particle acceleration. Indeed, they are
increasingly considered as being responsible for a significant fraction of
cosmic rays (CRs) accelerated within the Milky Way. Westerlund 1, the most
massive known young stellar cluster in our Galaxy is a prime candidate for
studying this hypothesis. While the very-high-energy $\gamma$-ray source HESS
J1646-458 has been detected in the vicinity of Westerlund 1 in the past, its
association could not be firmly identified. We aim to identify the physical
processes responsible for the $\gamma$-ray emission around Westerlund 1 and
thus to better understand the role of massive stellar clusters in the
acceleration of Galactic CRs. Using 164 hours of data recorded with the High
Energy Stereoscopic System (H.E.S.S.), we carried out a deep
spectromorphological study of the $\gamma$-ray emission of HESS J1646-458. We
furthermore employed H I and CO observations of the region to infer the
presence of gas that could serve as target material for interactions of
accelerated CRs. We detected large-scale ($\sim 2^\circ$ diameter) $\gamma$-ray
emission with a complex morphology, exhibiting a shell-like structure and
showing no significant variation with $\gamma$-ray energy. The combined energy
spectrum of the emission extends to several tens of TeV, and is uniform across
the entire source region. We did not find a clear correlation of the
$\gamma$-ray emission with gas clouds as identified through H I and CO
observations. We conclude that, of the known objects within the region, only
Westerlund 1 can explain the bulk of the $\gamma$-ray emission. Several CR
acceleration sites and mechanisms are conceivable, and discussed in detail.
(abridged)
