This study evaluated the effect of sodium butyrate (SB) on performance, expression of immune-related genes in the cecal tonsils, and cecal microbiota of broiler chickens when dietary energy and amino acids concentrations were reduced. Day-old male Ross 708 broiler chicks were fed dietary treatments in a 3 × 2 factorial design (8 pens per treatment) with 3 dietary formulations (control diet; reduction of 2.3% of amino acids and 60 kcal/kg; and reduction of 4.6% of amino acids and 120 kcal/kg) with or without the inclusion of 0.1% of SB. Feed intake (FI), body weight gain (BW gain), and feed conversion ratio (FCR) were recorded until 28 d of age. From 14 to 28 d, there was an interaction of nutrient density by SB (P = 0.003) wherein BW gain of birds fed SB was impaired less by the energy/amino acids reduction than unsupplemented birds. A similar result was obtained from 1 to 28 d (P = 0.004). No interaction (P < 0.05) between nutrient density by SB was observed for FCR. Nutritional density of the diets and SB modified the structure, composition, and predicted function of the cecal microbiota. The nutritionally reduced diet altered the imputed function performed by the microbiota and the SB supplementation reduced these variations, keeping the microbial function similar to that observed in chickens fed a control diet. The frequency of bacterial species presenting the butyryl-CoA: acetate CoA-transferase gene increased in the microbiota of chickens fed a nutritionally reduced diet without SB supplementation, and was not changed by nutrient density of the diet when supplemented with SB (interaction; P = 0.01). SB modulated the expression of immune related genes in the cecal tonsils; wherein SB upregulated the expression of A20 in broilers fed control diets (P < 0.05) and increased IL-6 expression (P < 0.05). These results show that SB had positive effects on the productive performance of broilers fed nutritionally reduced diets, partially by modulating the cecal microbiota and exerting immune-modulatory effects.