Let f be a primitive Hilbert modular cusp form of arbitrary level and parallel weight k, defined over a totally real number field F. We define a finite set of primes $\cal S$ that depends on the weight and level of f, the field F, and the torsion in the boundary cohomology groups of the Borel–Serre compactification of the underlying Hilbert-Blumenthal variety. We show that, outside $\cal S$, any prime that divides the algebraic part of the value at s=1 of the adjoint L-function of f is a congruence prime for f. In special cases we identify the ‘boundary primes’ in terms of expressions of the form $N_{F/{\mathbb{Q}}}(\epsilon^{k-1} - 1)$, where ε is a totally positive unit of F.