Voltage security and congestion management are crucial issues in power systems, especially under heavily loaded conditions. In the new scheme of electricity restructuring, voltage security problems become even more serious. Due to the increase in stability margins, FACTS devices are the best option to mitigate voltage instability by reactive power management. The main purpose of this paper is to identify the optimal location and capacity of the Static SynchronousCompensator (STATCOM) to enhance voltage security and identify the capacity of a properly placed IPFC to manage transmission network congestion simultaneously. Artificial intelligence is implemented as a heuristic technique to this complicated constrained optimization problem. The proposed method demonstrates the improvement of the voltage security margin, as well as solving congestion management problems. Significant results through a modified IEEE 14-bus case study show the effectiveness of the proposed algorithm.