Aims: We aim to measure the starspot rotation periods of active stars in the Kepler field as a function of spectral type and to extend reliable rotation measurements from F-, G-, and K-type to M-type stars. Methods: Using the Lomb-Scargle periodogram we searched more than 150 000 stellar light curves for periodic brightness variations. We analyzed periods between 1 and 30 days in eight consecutive Kepler quarters, where 30 days is an estimated maximum for the validity of the PDC_MAP data correction pipeline. We selected stable rotation periods, i.e., periods that do not vary from the median by more than one day in at least six of the eight quarters. We averaged the periods for each stellar spectral class according to B - V color and compared the results to archival vsini data, using stellar radii estimates from the Kepler Input Catalog. Results: We report on the stable starspot rotation periods of 12 151 Kepler stars. We find good agreement between starspot velocities and vsini data for all F-, G- and early K-type stars. The 795 M-type stars in our sample have a median rotation period of 15.4 days. We find an excess of M-type stars with periods less than 7.5 days that are potentially fast-rotating and fully convective. Measuring photometric variability in multiple Kepler quarters appears to be a straightforward and reliable way to determine the rotation periods of a large sample of active stars, including late-type stars.