The inhibition of the corrosion of mild steel in 1 M H 2 SO 4 solution by the pharmaceutically active compound esomeprazole (ESP) has been investigated by using weight loss, potentiodynamic polarization, and electrochemical impedance spectroscopy measurements. The effect of temperature on the corrosion behavior with the addition of different concentrations of ESP was studied in the temperature range of 30-60 ∘ C. Results obtained revealed that the inhibition efficiency increased with the increase in concentration of the inhibitor but decreased with the increase in temperature. The addition of KI increased the inhibition of ESP to a considerable extent. The experimental results suggest that the presence of iodide ions in the solution stabilized the adsorption of the ESP molecule on the mild steel surface, thereby improving the inhibition efficiency. Polarization curves indicated that the ESP belonged to a mixed-type inhibitor. Adsorption of the inhibitor on the mild steel surface is found to obey the Langmuir adsorption isotherm. Some thermodynamic functions of dissolution and adsorption processes were also determined. Surface analysis via scanning electron microscope (SEM) and atomic force microscope (AFM) shows a significant improvement in the surface morphology of the mild steel plate.