We investigated the usefulness of the coal combustion by-products, Class C fly ash (C) and ClassF fly ash (F), in developing cost-effective acid resistant phosphate-based cements for geothermal wells. In the temperature range of 20-100 °C, sodium polyphosphate (NaP) as the acidic cement forming solution preferentially reacted with calcium sulfate and lime in the C as the base solid reactant through the exothermic acid-base reaction route, rather than with the tricalcium aluminate in C. This reaction led to the formation of hydroxyapatite (HOAp). In contrast, there was no acid-base reaction between the F as the acidic solid reactant and NaP. After autoclaving the cements at 250º, a well crystallized HOAp phase was formed in the NaP modified C Cement that was responsible for densifying the cement's structure, thereby conferring low water permeability and good compressive strength on the cement. However, the HOAp was susceptible to hot CO2 laden H2SO4 solution (pH 1.1), allowing some acid erosion of the cement. On the other hand, the mullite in F- hydrothermally reacted with the Na from NaP to form the anaclime phase. Although this phase played a pivotal role in abating acid erosion, its generation created an undesirable porous structure in the cement. We demonstrated that blending fly ash with a C/F ratio of 70/30 resulted in the most suitable properties for acid resistant phosphate-based cement systems.