We determined the short‐ and medium‐term effects of prescribed burns on soil organic matter content and biological activity in grazing areas invaded by the shrub Echinospartum horridum (Vahl) Rothm. in the Pyrenees of Huesca (Spain). Soil samples were collected at 0–1, 1–2, and 2–3 cm depths in triplicate just before the burn, immediately after the burn (T0), and 1 and 5 years later (T1 and T5). We analysed the contents of total soil organic C and N, soil respiration, microbial biomass C, and β‐d‐glucosidase and acid phosphatase activities. Fire provoked an immediate high decrease in the contents of soil organic C (−40.2%) and N (−26.3%) in the first 3 cm, which were even lower at T5 (−50.3% and −46.5%, respectively). This can be explained as follows: (a) low incorporation of burned organic matter due to removal by wind and run‐off; (b) changes in microclimate increasing soil temperature and enhancing mineralization; and (c) a stimulating effect on decomposition due to the release of nutrients. Soil biological activity was affected at T0 in the first 3 cm (−49.3% glucosidase, −48.2% phosphatase, and −54.5% respiration rate). Microbial biomass C content was also affected by fire at T0 (−32.3%) but was close to its initial value at T5. The results suggest that these soils are particularly sensitive to fire. Adjusting the frequency and intensity of the burns is necessary to minimize their impact on the soil and to ensure the suitability of this management practice.