Dear Editor, The optimal formation control design problem is studied for a class of second-order multi-agent systems (MASs) with obstacle avoidance. Based on the actor-critic framework, an optimized formation controller is proposed by constructing a novel performance index function. Furthermore, the stability of MAS is proved by constructing the Lyapunov function. The simulation results are provided to depict the effectiveness of the proposed strategies.