We establish a new asymptotic formula for the number of polynomials of degree n with k prime factors over a finite field Fq. The error term tends to 0 uniformly in n and in q, and k can grow beyond log n. Previously, asymptotic formulas were known either for fixed q, through the works of Warlimont and Hwang, or for small k, through the work of Arratia, Barbour and Tavaré.As an application, we estimate the total variation distance between the number of cycles in a random permutation on n elements and the number of prime factors of a random polynomial of degree n over Fq. The distance tends to 0 at rate 1/(q √ log n). Previously this was only understood when either q is fixed and n tends to ∞, or n is fixed and q tends to ∞, by results of Arratia, Barbour and Tavaré.