The effects of H2O, CO2, CH4 and HF on partial melting of a model phlogopite harzburgite mantle are considered with regard to the production of ultrapotassic magmas. Fluorine has a polymerising effect in H2O-poor conditions, but in the presence of abundant H2O where HF rather than F is dominant, the overall effect is depolymerisation. Methane also dissolves by forming (OH)- groups, and so has a depolymerising effect. Group I ultrapotassic rocks (lamproites) probably originate from primary magmas with SiO2 contents ranging from around 40 wt% to at least 52 wt%. This range can be explained by differing depths of origin from a similar source with a similar reduced H2O-CH4-HF volatile mixture. The formation of silica-rich initial melts from a model phlogopite harzburgite is assisted by the presence of CH4 and HF. Dissociation of less than 0.1 wt% H2O, driven by H2 loss, is sufficient to cause oxidation during emplacement to observed oxidation states. Silica-poor ultrapotassic rocks could be produced at higher pressures in a reduced environment, or in an oxidised environment with high CO2/(CO2 + H2O) ratios. Group II (African Rift) potassic rocks may originate in H2O-poor conditions in which fluorine will maintain a large phlogopite phase field, so that initial melts will be magnesian and silica-undersaturated.