In this report, we consider the fractional optimal control problems (FOCPs), where the behaviour of these problems dependent on the effects of fractional derivatives. The variational iteration method is used to introduce the definition of fractional derivatives in the Ji Huan He’s sense. We obtain the necessary and sufficient optimality conditions for vector function and we present a method to solve the FOCPs. In this method the Legendre multiwavelet basis with the aid of a collocation method has been applied to give the approximate solution for the FOCPs. The properties of the Legendre multiwavelet and the collocation method are then utilized to reduce the problem to the solution of an algebraic system. The obtained results are in good agreement with the existing ones in open literature and it is shown that the present method is very effective and accurate.