Modern number theory began with the work of Euler and Gauss to understand and extend the many unsolved questions left behind by Fermat. In the course of their investigations, they uncovered new phenomena in need of explanation, which over time led to the discovery of field theory and its intimate connection with complex multiplication.While most texts concentrate on only the elementary or advanced aspects of this story, Primes of the Form x2 + ny2 begins with Fermat and explains how his work ultimately gave birth to quadratic reciprocity and the genus theory of quadratic forms. Further, the book shows how the results of Euler and Gauss can be fully understood only in the context of class field theory. Finally, in order to bring class field theory down to earth, the book explores some of the magnificent formulas of complex multiplication.The central theme of the book is the story of which primes p can be expressed in the form x2 + ny2. An incomplete answer is given using quadratic forms. A better though abstract answer comes from class field theory, and finally, a concrete answer is provided by complex multiplication. Along the way, the reader is introduced to some wonderful number theory. Numerous exercises and examples are included.The book is written to be enjoyed by readers with modest mathematical backgrounds. Chapter 1 uses basic number theory and abstract algebra, while chapters 2 and 3 require Galois theory and complex analysis, respectively.