Background The interactive effect of mental fatigue and caffeine consumption on sport performance is not clear. This study aimed to investigate the impact of mental fatigue and caffeine gum consumption on power and skill performance in recreationally trained male basketball players. Methods A randomized, double-blind, crossover design was used, with twenty male participants (age: 16.7 +/- 0.86 years, body mass: 79.6 +/- 8.2 kg, height: 183.2 +/- 8.6 cm, training experience >= 3 years). Participants completed four testing sessions under the following conditions: (1) no mental fatigue with placebo gum, (2) mental fatigue with placebo gum, (3) no mental fatigue with caffeine gum, and (4) mental fatigue with caffeine gum. The sessions were separated by one week. Mental fatigue was induced through a 30-minute Stroop task, and caffeine gum (50 mg of caffeine per piece) was administered 15 minutes before performance testing. Power and skill performance were assessed via vertical jump height, V-CUT dribbling test, medicine ball throw, and stationary two-point shooting, with three attempts per test. Results Mental fatigue significantly increased time to react for congruent name and color (Z = 3.9, p < 0.001) and incongruent name and color (Z = 3.9, p < 0.001), as well as perceived fatigue (Z = 3.9, p < 0.001) after the Stroop task. Performance analysis revealed a significant main effect of condition on vertical jump height (F = 2.9, p = 0.04) and V-CUT dribbling performance (F = 4.4, p = 0.007), but not on medicine ball throw, change of direction test, or stationary two-point shooting (p > 0.05). Mental fatigue (mental fatigue with placebo gum) significantly impaired vertical jump height (p = 0.008) and V-CUT dribbling performance (p = 0.049) compared to the no mental fatigue with placebo gum condition. No significant differences were found between other condition pairs for these performance measures. Conclusion Mental fatigue negatively affects power and skill performance in basketball players, while caffeine gum consumption may offer a potential strategy to mitigate these effects. While caffeine gum attenuated some performance declines in the mental fatigue with caffeine gum condition compared to mental fatigue with placebo gum, these differences were not statistically significant. Future research should explore optimal caffeine doses and additional performance variables.