In this work, we consider a fractional optimal control problem (FOCP) containing a nonlinear control system, described by a differential equation involving a Hilfer derivative, and an integral cost functional. We study the existence and uniqueness of a solution of the control system as well as the necessary and sufficient optimality conditions of FOCP.