This work presents particle swarm optimization (PSO) based method to solve the optimal power flow in power systems incorporating flexible AC transmission systems controllers such as thyristor controlled phase shifter, thyristor controlled series compensator and unified power flow controller for security enhancement under single network contingencies. A fuzzy contingency ranking method is used in this paper and observed that it effectively eliminates the masking effect when compared with other methods of contingency ranking. The fuzzy based network composite overall severity index is used as an objective to be minimized to improve the security of the power system. The proposed optimization process with PSO is presented with case study example using IEEE 30-bus test system to demonstrate its applicability. The results are presented to show the feasibility and potential of this new approach. © 2014, The Institution of Engineers (India).