This paper examines the use of surfactant gels during matrix acid treatments and describes field trials of these fluids. Unlike available viscoelastic surfactants used today in the field, this surfactant is cationic. If used in live acids, the fluid has a relatively low viscosity when pumped. Once the acid is spent, however, the surfactant molecules increase its viscosity significantly. To enhance diversion further, the acidic fluids or brines can be foamed with this surfactant.Rheological measurements were conducted on Hastelloy Wfitted rotational viscometers at temperatures ranging from 70 to 300 F. The effects of surfactant concentration, shear rate, temperature, and acid additives on the apparent viscosity of various surfactant-based fluids were investigated in detail.The surfactant was stable thermally and hydrolytically with most acid additives. While it was compatible (i.e., still formed a viscosifying gel), some additives adversely affected the apparent viscosity of surfactant solutions at a given temperature. The apparent viscosity of surfactant solutions increased with salt concentration and can be predicted by use of the Carreau-Yasuda model. Coreflood tests indicated that the surfactant delayed acid breakthrough in calcite cores. Acceptable corrosion rates were obtained when this surfactant was added to the acid.The performance of this surfactant was validated with field treatments. The surfactant was used in more than 100 matrix acid treatments (oil producers and water injectors). It was used to increase the viscosity of acids in situ and enhance the stability of foams used for diversion. All wells responded positively to these treatments, and no operational problems were encountered. Downhole gauges confirmed the ability of surfactant-based fluids to divert the acid into various zones.