With the daily expansion of global energy consumption, developing the power grids is of uttermost importance. However, building a new transmission line is costly and time-consuming, so utilizing the same lines with possible higher transmission capacity is very cost-effective. In this regard, to increase the capacity of the transmission lines, the flexible alternating current transmission system (FACTS) has been widely used in power grids in recent years by industrialized countries. One of the essential topics in electrical power systems is the reactive power compensation, and the FACTS plays a significant role in controlling the reactive power current in the power grid and the system voltage oscillations and stability. When a static synchronous compensator (STATCOM) is embedded in a power system to increase the bus voltage, a supplementary damping controller can be designed to enhance the system oscillation damping. Given the expansion of the grids in the power system, the complexity of their optimization and the extraordinary ability of the imperialist competitive algorithm (ICA) for solving such problems, in this paper, the ICA has been used to determine the optimal position and size of the FACTS devices.