A rhizomatous perennial herb, occurring, often as a pioneer, in a wide range of moist or dry, often disturbed habitats, which include sand dunes and shingle, slumping cliff-slopes, landslides, spoil heaps, seepage areas, rough grassland, crumbling river banks, waste places and roadside verges. It can also be a troublesome arable weed. 0-1065 m in the Breadalbanes (Mid Perth).
The distribution has shown little overall change since the 1962 Atlas. It is alien in Shetland, where it was first recorded in 1841.
Eurosiberian Boreo-temperate element; widely naturalised outside its native range.