Gelled acids can be used in acidizing treatments for carbonate reservoirs for two reasons; to increase the wormholing efficiency of the fluid, and also as a diverting agent. Viscoelastic surfactants can be used as gelling agents for acids, in which the viscosity increases as the acid spends and pH increase to 3-4. Pore holes are plugged with the additional viscosity, encouraging acid further into the formation. The viscosity will then break upon contact with oil, and leave negligible residual damage in the formation. In varying formulations, viscoelastic can act as a diverter, though this time the viscosity will act to redirect the fluid from higher permeability “thief” zones, to lower permeability streaks that may remain otherwise unstimulated. This is particularly useful in long wellbore sections, to achieve a more uniform acidizing effect, and optimum coverage of the reservoir.