The present invention relates to a composition with fungicidal and bactericidal activity, which comprises volatile organic compounds (VOCs) obtained from plants and microorganisms, in which said VOCs are C4-C12 fatty alcohols or cyclic alcohols or phenol-derived compounds, or terpene-derived compounds, and also derivatives and mixtures thereof. Furthermore, the present invention likewise relates to the use of said compositions in the protection of agricultural crops, in post-harvest treatments, in food preservation and in the disinfection of facilities and equipment.