The high penetration of renewable energy sources, combined with a limited possibility to expand the transmission infrastructure, stretches the system stability in the case of faults. For this reason, operators are calling for additional control flexibility in the grid. In this paper, we propose the deployment of switchable reactors and capacitors distributed on the grid as a control resource for securing operations during severe contingencies and avoiding potential blackouts. According to the operating principles, the line reactance varies by switching on or off a certain number of distributed series reactors and capacitors and, therefore, the stabilizing control rule is based on a stepwise time-discrete control action. A control strategy, based on dynamic optimization, is proposed and tested on a realistic-sized transmission system.