Apatite (Ca5(PO4)3(OH, F, Cl)) is one of the main host of halogens in magmatic and metamorphic rocks and plays a unique role during fluid–rock interaction as it incorporates halogens (i.e. F, Cl, Br, I) and OH from hydrothermal fluids to form a ternary solid solution of the endmembers F-apatite, Cl-apatite and OH-apatite. Here, we present an experimental study to investigate the processes during interaction of Cl-apatite with different aqueous solutions (KOH, NaCl, NaF of different concentration also doped with NaBr, NaI) at crustal conditions (400–700 °C and 0.2 GPa) leading to the formation of new apatite. We use the experimental results to calculate partition coefficients of halogens between apatite and fluid. Due to a coupled dissolution–reprecipitation mechanism new apatite is always formed as a pseudomorphic replacement of Cl-apatite. Additionally, some experiments produce new apatite also as an epitaxial overgrowth. The composition of new apatite is mainly governed by complex characteristics of the fluid phase from which it is precipitating and depends on composition of the fluid, temperature and fluid to mineral ratio. Furthermore, replaced apatite shows a compositional zonation, which is attributed to a compositional evolution of the coexisting fluid in local equilibrium with the newly formed apatite. Apatite/fluid partition coefficients for F depend on the concentration of F in the fluid and increase from 75 at high concentrations (460 μg/g F) to 300 at low concentrations (46 μg/g F) indicating a high compatibility of F in apatite. A correlation of Cl-concentration in apatite with Cl− concentration of fluid is not observed for experiments with highly saline solutions, composition of new apatite is rather governed by OH− concentration of the hydrothermal fluid. Low partition coefficients were measured for the larger halogens Br and I and vary between 0.7 * 10−3–152 * 10−3 for Br and 0.3 * 10−3–17 * 10−3 for I, respectively. Br seems to have D values of about one order of magnitude higher than I. These data allow an estimation of the D values for the other halogens based on a lattice strain model which displays a sequence with DF of ∼120, DOH of ∼100, DCl of ∼2.3 DBr ∼0.045, and DI ∼0.0025. Results from this experimental study help to better understand fluid–rock interaction of an evolving fluid, as it enables the composition of hydrothermally derived apatite to be used as a fluid probe for halogens at crustal conditions. It further shows the importance of mineral replacement as one of the key reactions to generate apatite of different composition.