A constrained dynamic optimization problem of a fractional order system with fixed final time has been considered here. This paper presents a general formulation and solution scheme of a class of fractional optimal control problems. The dynamic constraint is described by a fractional differential equation of order less than 1, and the fractional derivative is defined in terms of Riemann–Liouville. The performance index includes the terminal cost function in addition to the integral cost function. A general transversility condition in addition to the optimal conditions has been obtained using the Hamiltonian approach. Both the specified and unspecified final state cases have been considered. A numerical technique using the Grünwald–Letnikov definition is used to solve the resulting equations obtained from the formulation. Numerical examples are provided to show the effectiveness of the formulation and solution scheme. It has been observed that the numerical solutions approach the analytical solutions as the order of the fractional derivatives approach 1.