Let $n$ be a positive squarefree integer, and let $h_n$ denote the class number of the imaginary quadratic field $\mathbb{Q}(\sqrt{-n})$. Then, is it true that $h_n$ is odd if and only if $n$ is a prime? If yes, then could you please provide a reference to this statement?

I'm new to class field theory and genus theory so I do not know what's been proven or known about this in the literature.

Thank you.