This paper concerns a distributed optimal control problem for a tumor growth model of Cahn–Hilliard type including chemotaxis with possibly singular potentials, where the control and state variables are nonlinearly coupled. First, we discuss the weak well-posedness of the system under very general assumptions for the potentials, which may be singular and nonsmooth. Then, we establish the strong well-posedness of the system in a reduced setting, which however admits the logarithmic potential: this analysis will lay the foundation for the study of the corresponding optimal control problem. Concerning the optimization problem, we address the existence of minimizers and establish both first-order necessary and second-order sufficient conditions...