In this study, we evaluated the antifungal activity of essential oils from two provenances of O. compactum, from two Moroccan forests, against wood-decay fungi responsible for most of the damage to the timber service. Essential oils of the aerial parts of O. compactum were extracted by hydrodistillation, analyzed by gas chromatography-mass spectrometry (GC-MS) and tested against four fungi (Trametes versicolor, Coniophora puteana, Gloeophyllum trabeum and Poria placenta). Our results showed that thymol (20.49%, 27.49%), carvacrol (16.68%, 25.31%), ã- terpinene (26.11%, 22.65%) and o-cimene (20.68%, 9.76 %) were the main constituents present in essential oils of both O. compactum provenances. Bioactivity experiment revealed that the two essential oils tested had a strong antifungal activity against all of the fungi studied, which is very likely due to the high content of thymol and carvacrol. This finding suggests the use of these essential oils as an environmentally friendly preservative against white- and brown-rot fungi.