The composition and activity of gut microbiota were analyzed in laying hens fed for 24 weeks a control diet containing soybean meal (diet C) and two experimental diets supplemented with 10% or 20% blue lupine seed meal used as a substitute for soybean meal (diets L10 and L20, respectively). In comparison with soybean, lupine seeds had a higher content of neutral detergent fiber (NDF) and raffinose family oligosaccharides (RFOs) (25.4% vs. 9.61% and 7.98% vs. 5.91%). The dietary 20% lupine seeds increased the content of NDF and RFOs in the ration, from 10.5% to 12.54% and from 0.77% to 2.08%, respectively. The final body weights of layers, and the number and weight of eggs laid were similar in all groups. In comparison with group C, group L20 hens were characterized by a lower dry matter concentration of digesta (P=0.024), and higher activity of mucosal sucrase in the small intestine (P=0.006). The following differences were noted between groups with respect to the counts of bacteria identified in the cecal digesta: total bacterial counts—C<L10 and L20 (P=0.004), Lactobacillus/Enterococcus—C<L20 (P=0.014), Bifidobacterium sp..—C<L10<L20 (P=0.001), Escherichia coli—C>L10>L20 (P=0.001). Group L20 birds, compared with group C, had higher activity levels of cecal bacterial glycolytic enzymes, α- and β-glucosidase, α- and β-galactosidase and α-arabinopyranosidase (P=0.001 in all cases), and an increase close to significance (P=0.105) in the cecal pool of short-chain fatty acids. Cecal ammonia concentrations were lower in both lupine-fed groups than in control group (P=0.004), and digesta pH was lower in group L20 than in the other two groups (P=0.001). The results of our study indicate that the inclusion of blue lupine seeds at 20% of the layer diet, and to lower extent at the 10% dietary dosage, had a positive effect on the cecal microbiota. In regard to cecal microbiota composition, the shift toward higher percentage of potentially beneficial bacteria groups (Bifidobacterium sp., Lactobacillus and/or Enterococcus) was manifested upon 20% of lupine seeds in a diet and both dietary lupine levels decreased the percentage of the potential pathogenic bacteria Bacteroides, Prevotella and E. coli. The above positive changes in the composition of cecal microbiota might prevent a deterioration in the laying performance of hens fed diets supplemented with lupine seeds which considerably increased the content of NDF and RFOs in the ration.