  We prove a diophantine result on generalized Fermat equations of the form
$x^p + y^p = z^r$ which for the first time requires the use of Frey abelian
varieties of dimension $\geq 2$ in Darmon's program. For that, we provide an
irreducibility criterion for the mod $\mathfrak{p}$ representations attached to
certain abelian varieties of $\text{GL}_2$-type over totally real fields.
