Power-to-gas (P2G) and gas-fired generation units (GFGUs) enable the bidirectional energy flow of integrated energy systems (IESs). The static security of IES should be analysed considering the interdependence between energy systems. In this study, the static security of IES is analysed, and a novel static security control strategy to improve the security of IES after N−1 contingency is proposed considering P2G. First, electricity-gas IES model is presented, and the multi-energy flow of IES is solved by the Newton-Raphson method. Then, N − 1 static security analysis is carried out for the electricity system and natural gas system. Based on the obtained Jacobian matrix during the energy flow calculation process after N − 1 contingency, variable sensitivity matrixes of voltage, gas pressure, branch power flow and pipeline flow to control variables are derived. Furthermore, a static security control strategy for IES based on the sensitivity matrices is developed to regulate operation statuses of P2G and GFGU and compressor outlet pressure to mitigate the violation of security constraints. The performance of the proposed analysis method and control strategy is evaluated by IES 4-12 and IES 118-48 test systems. The results demonstrate that the proposed control strategy can mitigate security risks of IES after N − 1 contingencies.