Abstract.In this paper, we study a linear-quadratic optimal control problem with a fractional control system containing a Caputo derivative of unknown function. First, we derive the formulas for the differential and gradient of the cost functional under given constraints. Next, we prove an existence result and derive a maximum principle. Finally, we describe the gradient and projection of the gradient methods for the problem under consideration.