Akaganeite, a Cl-bearing Fe(III) (hydr)oxide, has been reported in several locations on Mars, including Yellowknife Bay in Gale crater and Robert Sharp crater, but formation conditions remain unknown. We investigated akaganeite precipitation as a function of solution pH and chloride concentration. Akaganeite was synthesized through hydrolysis of Fe(III) perchlorate in the presence of 0.02, 0.05 and 0.1 M chloride and at initial solution pH of 1.6, 4, 6 and 8 at 90 deg C. Mineralogy of the precipitated Fe(III) (hydr)oxides was characterized by X-ray diffraction (XRD), infrared spectroscopy and Mössbauer spectroscopy and total chloride and perchlorate contents were determined by ion chromatography. XRD revealed that akaganeite formed alone or in mixtures with ferrihydrite, hematite and/or goethite at initial pH 1.6 with 0.02, 0.05 and 0.1 M Cl- and at initial pH from 4 to 8 with 0.05 and 0.1 M Cl-. Mössbauer parameters for akaganeite and ferrihydrite were similar to nanophase Fe(III) oxide reported on Mars. Infrared analysis revealed that akaganeite bands at ~2 and ~2.45 μm were sensitive to amount of akaganeite, total chloride content and presence of other Fe(III) (hydr)oxides. The obtained results indicate that akaganeite in Yellowknife Bay likely formed under acidic to alkaline (1.6 < pH < 8) oxidizing conditions in solutions containing > 0.05 M Cl- by the dissolution of basaltic minerals. Akaganeite in Robert Sharp crater may have formed in acidic pH < 4 solutions with ~ 0.1 M Cl- through oxidative dissolution of Fe(II) sulfides and/or oxidizing dissolution of basalts in localized acidic solutions.