Soil compaction is a major disturbance associated with logging, but we lack a fundamental understanding of how this affects the soil microbiome. We assessed the structural resistance and resilience of the microbiome using a high-throughput pyrosequencing approach in differently compacted soils at two forest sites and correlated these findings with changes in soil physical properties and functions. Alterations in soil porosity after compaction strongly limited the air and water conductivity. Compaction significantly reduced abundance, increased diversity, and persistently altered the structure of the microbiota. Fungi were less resistant and resilient than bacteria; clayey soils were less resistant and resilient than sandy soils. The strongest effects were observed in soils with unfavorable moisture conditions, where air and water conductivities dropped well below 10% of their initial value. Maximum impact was observed around 6-12 months after compaction, and microbial communities showed resilience in lightly but not in severely compacted soils 4 years post disturbance. Bacteria capable of anaerobic respiration, including sulfate, sulfur, and metal reducers of the Proteobacteria and Firmicutes, were significantly associated with compacted soils. Compaction detrimentally affected ectomycorrhizal species, whereas saprobic and parasitic fungi proportionally increased in compacted soils. Structural shifts in the microbiota were accompanied by significant changes in soil processes, resulting in reduced carbon dioxide, and increased methane and nitrous oxide emissions from compacted soils. This study demonstrates that physical soil disturbance during logging induces profound and long-lasting changes in the soil microbiome and associated soil functions, raising awareness regarding sustainable management of economically driven logging operations.