Gas inflow control in oil wells is one of the most challenging types of repair and sealing operations, the success rate of which does not exceed, as a rule, 30%. Conventional shutoff methods are often ineffective for this purpose. For instance, cement solutions cannot be injected into wells in the required volumes, while gel screens can only temporarily block the breakthrough zones, as gas easily seeps through the gel, forming new channels for gas inflow. Technology for the two-stage injection of gas-insulating gel systems for gas control in horizontal wells was developed. At the first stage, a self-generating foam gel composition (FGC), consisting of gel-forming and gas-forming compositions, was used. A foam gel structure with enhanced rheological and flow characteristics was formed over a controlled time as a result of the interaction between the gel-forming and gas-forming compounds. A PAM-based hydrogel crosslinked with an organic crosslinker was added to the FGC at the second stage of treatment. The laboratory experiments substantiated the technology of well gas and water shutoff by the sequential injection of self-generating foam gel composition and hydrogel. Field tests confirmed the correctness of the chosen concept. It is very important to clearly identify the sources of gas inflow for the success of this well intervention and take into account the well design, as well as the reservoir geological structure and characteristics. The gas shutoff operation can be properly designed for each well only by comparing all these factors. The validity of the selected technology was tested through a series of laboratory experiments. Successful laboratory tests allowed for the application of the studied technology in a field setting, where the gas shutoff agent was injected into three horizontal wells. As a result of the field application, the gas inflow was successfully isolated in two wells. However, the application of the technology failed in the third well which gave an opportunity to revisit the technology’s design and to review the sources of gas inflow. Overall, the achieved success rate of 66% demonstrated the high efficiency of the studied technology and supported its wider application in the field.