Soil compaction represents a major challenge for modern agriculture. Compaction is intuitively thought to reduce root growth by limiting the ability of roots to penetrate harder soils. We report that root growth in compacted soil is instead actively suppressed by the volatile hormone ethylene. We found that mutant Arabidopsis and rice roots that were insensitive to ethylene penetrated compacted soil more effectively than did wild-type roots. Our results indicate that soil compaction lowers gas diffusion through a reduction in air-filled pores, thereby causing ethylene to accumulate in root tissues and trigger hormone responses that restrict growth. We propose that ethylene acts as an early warning signal for roots to avoid compacted soils, which would be relevant to research into the breeding of crops resilient to soil compaction.