  The soft emission factor is a central ingredient in the factorization of
generic $n$-particle gauge theory amplitudes with one soft gluon in the
external state. We present the complete two-loop soft factor, capturing the
leading power behavior in the soft-gluon momentum. At two loops, the color
structure and the kinematic dependence of the soft factor become nontrivial as
the soft gluon can couple to three hard partons for the first time (tripole
terms). The nontrivial kinematic dependence of the tripole terms is of uniform,
maximal transcendental weight, and can be expressed (in a "Euclidean" region)
in terms of single-valued harmonic polylogarithms. Our results are consistent
with the behavior of the recently computed symbol of the two-loop five-particle
amplitude in $\mathcal{N}=4$ super-Yang-Mills theory. In the limit where the
outgoing soft gluon is also collinear with an incoming hard parton, potentially
dangerous factorization-violating terms can arise, but they cancel after
summing over colors.
