An optimal control problem is studiedfor a Lotka-Volterra system of three differential equations. Itmodels an ecosystem of three species which coexist. The speciesare supposed to be separated from each others. Mathematically,this is modeled with the aid of two control variables. Somenecessary conditions of optimality are found in order to maximizethe total number of individuals at the end of a given timeinterval.