HD 219134 is a K-dwarf star at a distance of 6.5 parsecs around which several low-mass planets were recently discovered1,2. The Spitzer Space Telescope detected a transit of the innermost of these planets, HD 219134 b, whose mass and radius (4.5 M⊕ and 1.6 R⊕ respectively) are consistent with a rocky composition1. Here, we report new high-precision time-series photometry of the star acquired with Spitzer revealing that the second innermost planet of the system, HD 219134c, is also transiting. A global analysis of the Spitzer transit light curves and the most up-to-date HARPS-N velocity data set yields mass and radius estimations of 4.74 ± 0.19 M⊕ and 1.602 ± 0.055 R⊕ for HD 219134 b, and of 4.36 ± 0.22 M⊕ and 1.511 ± 0.047 R⊕ for HD 219134 c. These values suggest rocky compositions for both planets. Thanks to the proximity and the small size of their host star (0.778 ± 0.005 R☉)3, these two transiting exoplanets — the nearest to the Earth yet found — are well suited for a detailed characterization (for example, precision of a few per cent on mass and radius, and constraints on the atmospheric properties) that could give important constraints on the nature and formation mechanism of the ubiquitous short-period planets of a few Earth masses.