The colonization of land by plants appears to have coincided with the appearance of mycorrhiza-like fungi. Over evolutionary time, fungi have maintained their prominent role in the formation of mycorrhizal associations. In addition, however, they have been able to occupy other terrestrial niches of which the decomposition of recalcitrant organic matter is perhaps the most remarkable. This implies that, in contrast to that of aquatic organic matter decomposition, bacteria have not been able to monopolize decomposition processes in terrestrial ecosystems. The emergence of fungi in terrestrial ecosystems must have had a strong impact on the evolution of terrestrial bacteria. On the one hand, potential decomposition niches, e.g. lignin degradation, have been lost for bacteria, whereas on the other hand the presence of fungi has itself created new bacterial niches. Confrontation between bacteria and fungi is ongoing, and from studying contemporary interactions, we can learn about the impact that fungi presently have, and have had in the past, on the ecology and evolution of terrestrial bacteria. In the first part of this review, the focus is on niche differentiation between soil bacteria and fungi involved in the decomposition of plant-derived organic matter. Bacteria and fungi are seen to compete for simple plant-derived substrates and have developed antagonistic strategies. For more recalcitrant organic substrates, e.g. cellulose and lignin, both competitive and mutualistic strategies appear to have evolved. In the second part of the review, bacterial niches with respect to the utilization of fungal-derived substrates are considered. Here, several lines of development can be recognized, ranging from mutualistic exudate-consuming bacteria that are associated with fungal surfaces to endosymbiotic and mycophagous bacteria. In some cases, there are indications of fungal specific selection in fungus-associated bacteria, and possible mechanisms for such selection are discussed.