|Abstract||Enhanced gas recovery methods such as foamed CO2 are recommended for depleted gas reservoirs. Viscoelastic surfactant (VES) is a form of a surfactant used for forming CO2 foam. In this study, the impact of VES on CH4 and CO2 retention and adsorption in calcite rock samples was studied. Crushed samples of Indiana limestone rocks of average particle size (125-250 ?m) were used in the static adsorption experiments. To study the effect of VES on CH4 and CO2 adsorption, 50% of the crushed samples were conditioned in a solution of NaCl of 0.1 vol % surfactant. X-ray diffraction shows that the rock samples are 99.99% calcite and traces of quartz. The gas adsorption experiments were performed at different temperatures; namely; 50, 100, and 150 �C and at a pressure of 45 bar. At 50 �C, the plain calcite samples adsorbed more CH4 and CO2 compared to that treated with VES. However, at 100 and 150 �C, the plain sample adsorbed much less CH4 and CO2 than the treated sample. This means that at higher temperatures (100 and 150 �C) VES enhanced the adsorption of both CO2 and CH4 on the rock surface. Thermodynamic investigations showed that the process of gas adsorption in the plain samples was exothermic with ?Hads of -13.5 and -16.7 kJ/mol for CO2 and CH4, respectively, and at 50 �C the adsorption was spontaneous with ?Gads of -0.425 for CH4 and -2.599 for CO2. In contrast, at higher temperatures (100 and 150 �C), the adsorption of CO2 and CH4 on surfactant treated sample was spontaneous and endothermic with corresponding ?Hads of 36.2 and 60.1 kJ/mol and ?Gads of -4.701 and -0.581 for CO2 and CH4, respectively. The adsorption of CO2 was three times that of CH4 because of the high affinity of calcite to CO2. Because of the multilayer adsorption on both samples, Freundlich isotherm was found to be the best model that fits the experimental data of calcite with both CO2 and CH4 at different temperatures. Dynamic adsorption experiments were carried out using gas coreflooding system with the same calcite cores used in the static adsorption experiments. The results of this study showed that carbonate rock samples conditioned in the surfactant solution have great adsorption potential for CO2 and are excellent candidates for CO2 sequestration. However, surfactant promoted high CH4 adsorption at 100 and 150 �C, and this will reduce the natural gas recovery. In contrast, using viscoelastic surfactant at low-temperature reservoirs (50 �C) reduced CH4 adsorption by blocking the active adsorption sites in the carbonate rock samples, and this will increase the gas recovery. - 2018 American Chemical Society.