  We study an 't Hooft anomaly of massless QCD at finite temperature. With the
imaginary baryon chemical potential at the Roberge-Weiss point, there is a
$\mathbb{Z}_2$ symmetry which can be used to define confinement. We show the
existence of a mixed anomaly between the $\mathbb{Z}_2$ symmetry and the chiral
symmetry, which gives a strong relation between confinement and chiral symmetry
breaking. The anomaly is a parity anomaly in the QCD Lagrangian reduced to
three dimensions. It is reproduced in the chiral Lagrangian by a topological
term related to Skyrmion charge, matching the anomaly before and after QCD
phase transition. The effect of the imaginary chemical potential is suppresssed
in the large $N$ expansion, and we discuss implications of the 't~Hooft anomaly
matching for the nature of QCD phase transition with and without the imaginary
chemical potential. Arguments based on universality alone are disfavored, and a
first order phase transition may be the simplest possibility if the large $N$
expansion is qualitatively good.
