M-dwarf stars – hydrogen-burning stars that are smaller than 60 per cent of the size of the Sun – are the most common class of star in our Galaxy and outnumber Sun-like stars by a ratio of 12:1. Recent results have shown that M dwarfs host Earth-sized planets in great numbers1,2: the average number of M-dwarf planets that are between 0.5 to 1.5 times the size of Earth is at least 1.4 per star3. The nearest such planets known to transit their star are 39 parsecs away4 , too distant for detailed follow-up observations to measure the planetary masses or to study their atmospheres. Here we report observations of GJ 1132b, a planet with a size of 1.2 Earth radii that is transiting a small star 12 parsecs away. Our Doppler mass measurement of GJ ...