Ruminant production is an important source of animal proteins for human nutrition. However, ruminants contribute to about 30% of anthropogenic methane (CH4) emissions worldwide. The reduction of CH4 emissions could represent an important strategy against climate warming. Tannins can play an important role in the mitigation of CH4 emissions from ruminants. However, their mode of action is not yet well known. Thus, the present study aimed to gain a better understanding of the effect of ellagic acid (EA) and gallic acid (GA) on rumen fermentation using a model of short-term in vitro rumen fermentation. The basal diet (hay) was supplemented with EA and GA in five treatments (mg/g dry matter): i) EA 75, ii) EA 150, iii) GA 75, iv) GA 150 and v) EA 75 + GA 75. After a 24 h incubation, pH, ammonia formation, gas production, short-chain fatty acids (SCFA), in vitro organic matter digestibility (IVOMD) and the microbial count were assessed. Total gas production and digestible organic matter (dOM) were decreased after all the treatments, except for GA 75. The treatments EA 150 and EA+GA significantly decreased CH4 production per unit of dietary DM, dOM, CO2 and SCFA. Ammonia production was significantly decreased by EA 150 and EA+GA. EA and GA differently affected the relative abundance of selected bacterial taxa in rumen microbiota. To conclude, EA 150 and EA+GA exerted a significant effect on the reduction of CH4 emissions and ammonia formation, but affecting also the rumen degradability of the diet and the total SCFA production, whereas EA 75 and GA 75 were not effective as EA 150 and EA+GA on CH4 and ammonia, but were less detrimental on feed degradability and SCFA. Further studies are needed to determine whether the beneficial and detrimental effects of tannins on rumen fermentation can be dissociated.