In this paper, we propose an AC optimal power flow (ACOPF) model considering distributed flexible AC transmission system (D-FACTS) devices, in which the reactance of D-FACTS equipped lines are introduced as decision variables. This is motivated by increasing interests in using D-FACTS devices to address system operational and cyber-security concerns. First, D-FACTS devices can be incorporated in real-time operations for economic benefits such as managing power congestions and reducing system losses. Second, D-FACTS devices can be utilized by moving target defense (MTD), an emerging concept against cyber-attacks, to prevent attackers from knowing true system configurations. Therefore, system operators can use the proposed ACOPF model to achieve economic benefits and provide the setpoints of D-FACTS devices for MTD at the same time. In addition, we rigorously derive the gradient and Hessian matrices of the objective function and constraints, which are further used to build an interior-point solver of the proposed ACOPF. Numerical results on the IEEE 118-bus transmission system show the validity of the proposed ACOPF model as well as the efficacy of the interior-point solver in minimizing system losses and generation costs.