Apatites from carbonatites, related alkaline silicate rocks, a carbonate-bearing melilititic dyke rock (bergalite), and a diatreme breccia (containing both carbonate and silicate fragments) of the Miocene Kaiserstuhl Volcanic Complex, SW Germany, are used to reconstruct the petrogenetic relationship among these rocks. Apatites from carbonatites reach higher Sr and Nb contents but are generally lower in Fe, Mn, Th, U, Si, S, Cl and Br compared to apatites from associated silicate rocks, whilst Na, REE and F contents are overlapping. Apatites from bergalite show a systematic and discontinuous core-rim zonation, with the core being compositionally similar to apatites from silicate rocks and the rim corresponding to carbonatitic apatites. These observations imply that the bergalite apatites nucleated in a silicate melt and continued to crystallize from an evolving CO2-enriched melt probably with carbonatitic affinity. Apatites from a diatreme breccia comprise three populations: (1) similar to the apatites from silicate rocks, (2) similar to the carbonatitic apatites, and (3) resembling apatite population (1) partially replaced by apatite (2). We infer that apatite (1) was derived from silicate-rock fragments and apatite (2) crystallized from a later intruding carbonatitic melt, which metasomatized the silicate-rock fragments and caused the replacement textures as observed in apatite population (3). We conclude that apatites from the Kaiserstuhl complex preserve important information on the petrogenetic relationship between carbonatitic and silicate melts. The carbonatitic melts at the Kaiserstuhl complex are probably the products of protracted fractionation of a CO2-rich nephelinitic melt.