Summary Because of its low density, high viscosity, and good hole-cleaning performance, foam is used in the industry as a drilling and completion fluid. Due to these unique properties, foam can be applied in underbalanced drilling. After an extended period, however, the degradation of its thermodynamically unstable structure leads to the gradual loss of these valuable properties. While a number of research studies have been performed to investigate foam flow behavior, more is needed to know about their drainage characteristics and stability at high pressure. The primary goal of this investigation is to examine the effects of clay contaminants on the drainage of foam at high pressure. Moreover, the results and findings of this study not only show the effect of clay contaminants on foam stability but also help develop clay-based stable foam formulations without using chemicals that have the potential to contaminate groundwater or seawater. This paper shows the findings of an investigation on the aqueous foam stability in the presence of clay (bentonite and kaolinite) contaminants. Experiments were conducted at ambient temperature while varying foam quality and clay concentration at a constant pressure of 6.8 MPa. During the study, the foam was created in a flow loop. After generation, its rheology and stability were measured using a pipe viscometer and a vertical test tube (column). The hydrostatic pressure profile in the column was measured with time to assess foam drainage. The results show that clay type and concentration affect aqueous foam drainage and flow behavior. The impact of clay on these foam properties is controlled by foam quality. Adding more than 2.5% bentonite considerably enhanced foam stability and viscosity. In contrast, the impacts of kaolinite on these foam properties were minimal at the same concentration. The drainage became negligible when 5% bentonite was added to the foam. However, at a reduced concentration (2.5%), bentonite addition was only an effective stabilizer for low-quality foam (40%). Microscopic examination of the foams prepared under ambient conditions demonstrated the accumulation of colloidal particles at the plateau borders and nodes that block the drained liquid flow and reduce drainage.