  Let ${\mathcal C}_n$ be the set of all permutation cycles of length $n$ over
$\{1,2,\ldots,n\}$. Let $${\mathfrak f}_n(q):=\sum_{\sigma\in{\mathcal
C}_{n+1}}q^{{\mathrm maj}\,\sigma} $$ be a $q$-analogue of the factorial $n!$,
where ${\mathrm maj}$ denotes the major index. We prove a $q$-analogue of
Wilson's congruence $$ {\mathfrak f}_{n-1}(q)\equiv\mu(n)\pmod{\Phi_n(q)}, $$
where $\mu$ denotes the M\"obius function and $\Phi_n(q)$ is the $n$-th
cyclotomic polynomial.
