pH-responsive viscoelastic fluids are often achieved by adding hydrotropes into surfactant solutions. However, the use of metal salts to prepare pH-responsive viscoelastic fluids has been less documented. Herein, a pH-responsive viscoelastic fluid was developed by blending an ultra-long-chain tertiary amine,N-erucamidopropyl-N, N-dimethylamine (UC22AMPM), with metal salts (i.e., AlCl3, CrCl3, and FeCl3). The effects of the surfactant/metal salt mixing ratio and the type of metal ions on the viscoelasticity and phase behavior of fluids were systematically examined by appearance observation and rheometry. To elucidate the role of metal ions, the rheological properties between AlCl3− and HCl−UC22AMPM systems were compared. Results showed the above metal salt evoked the low-viscosity UC22AMPM dispersions to form viscoelastic solutions. Similar to HCl, AlCl3could also protonate the UC22AMPM into a cationic surfactant, forming wormlike micelles (WLMs). Notably, much stronger viscoelastic behavior was evidenced in the UC22AMPM−AlCl3systems because the Al3+as metal chelators coordinated with WLMs, promoting the increment of viscosity. By tuning the pH, the macroscopic appearance of the UC22AMPM−AlCl3system switched between transparent solutions and milky dispersion, concomitant with a viscosity variation of one order of magnitude. Importantly, the UC22AMPM−AlCl3systems showed a constant viscosity of 40 mPa·s at 80 °C and 170 s−1for 120 min, indicative of good heat and shear resistances. The metal-containing viscoelastic fluids are expected to be good candidates for high-temperature reservoir hydraulic fracturing.