The aim of this study was to determine the influence of compost and vermicompost produced from buffalo manure on soil bacterial diversity and activity in the presence and absence of the endogeic earthworm Metaphire posthuma. This experiment was carried out for 15 months with a maizeetomato emaize cycle under greenhouse conditions in Northern Vietnam. It showed a positive influence of compost and vermicompost on soil microbial properties, with higher cultivable bacteria, higher bacterial and catabolic diversity (Shannon diversity H' and Richness S') indices and higher enzymatic activities than control soils which only received mineral fertilizers. Differences also occurred between compost and vermicompost with lower activity and diversity in the soil amended with vermicompost, probably because of its higher molecular stability. The presence of M. posthuma led to divergent dynamics of bacterial community in soils amended with compost and vermicompost. Earthworms negatively influenced soil microbial properties in composted soil (lower Average Well Color Development AWCD'), probably because of competition between bacteria and earthworms for organic resources and/or because of the consumption of microbes by earthworms. Conversely, the presence of earthworms increased bacterial diversity and activity with higher AWCD, and H and S indices for the vermicompost treatment, probably as a result of a stimulation of microorganisms that allow the degradation of stable organic matter and its further consumption by earthworms. In conclusion, this study clearly confirmed the different impacts of compost and vermicompost on bacterial activity and diversity and highlighted the importance considering the interaction of these organic substrates with local endogeic earthworms.