Claviceps purpurea is a phytopathogenic ascomycete that parasitizes various grasses, most notably rye. Instead of a grain the infected host plant produces a fungal sclerotium in the autumn, containing toxic indole-alkaloids hazardous to animals and humans. Previously, three different genetic groups (G1-G3) with divergent habitat preferences and alkaloid chemistry have been detected, often referred to as C. purpurea ecotypes and chemoraces. The main aims of this study were to (1) analyse the genetic variation in C. purpurea in Norway, (2) characterise the indole-alkaloid profiles in relation to genetic groups, and (3) reveal the relationships between genetic groups, chemoraces and ecology. In total, 596 sclerotia from 14 different grass species were subjected to various analyses, including a sclerotial floating test, genetic analyses from which rDNA ITS and partial beta tubulin sequences were generated, and mass peaks of indole-alkaloids that were measured using HPLC-MS. After the floating test, all sclerotia were cut in halves in order to analyse one half genetically and one half chemically. Phylogenetic analyses and haplotype networks of genetic data supported three known (G1-G3) and one new (G4) genetic groups of C. purpurea, of which G1, G2 and G4 was present in Norway while G3 was absent. The new G4 group was supported also from chemical and ecological data. G4 produced sclerotia that were consistently floating, and was predominantly found in very wet habitats on Molinia caerulea, and occasionally also in saline habitats on Leymus arenarius. The G4 indole-alkaloid profile resembled that of G2, but differed with high amounts of the ergopeptam ergosedmam, a lactam congener of ergosedmine. Previously, G2 has been referred to as a chemorace based on its sole production of ergosine and ergocristine. The G2 sclerotia analysed in this study contained also mainly ergocristine, but in addition similar relative amounts of ergocryptine, and also lesser amounts of the other ergot alkaloids. A consistent presence of indole-diterpenoids in sclerotia from the G2 and G4 genetic groups was demonstrated, while these compounds with few exceptions were absent in the G1 genetic group. This study support that alkaloid chemistry is a function of the genetic groups, and that the indole-alkaloids profiles of C. purpurea sclerotia can be used to assign them to a specific genetic group. While G1 and G2 were found on numerous host plants and in different habitats, G3 and G4 seem to be more host and habitat specific. Co-occurrence of up to three genetic groups on the same host plant within the same habitat was observed. Thus, the results provided here suggest that the four groups G1-G4 in the C. purpurea complex represent four biological (cryptic) species rather than only ecotypes.