An n-ary operation Q:Σn→Σ is called an n-ary quasigroup of order |Σ| if in the equation x0=Q(x1,…,xn) knowledge of any n elements of x0,…,xn uniquely specifies the remaining one. An n-ary quasigroup Q is (permutably) reducible if Q(x1,…,xn)=P(R(xσ(1),…,xσ(k)),xσ(k+1),…,xσ(n)) where P and R are (n−k+1)-ary and k-ary quasigroups, σ is a permutation, and 1<k<n. An m-ary quasigroup R is called a retract of Q if it can be obtained from Q or one of its inverses by fixing n−m>0 arguments.We show that every irreducible n-ary quasigroup has an irreducible (n−1)-ary or (n−2)-ary retract; moreover, if the order is finite and prime, then it has an irreducible (n−1)-ary retract. We apply this result to show that all n-ary quasigroups of order 5 or 7 whose all binary retracts are isotopic to Z5 or Z7 are reducible for n≥4.