Path analysis was used to test the predictive and mediational role that self-efficacy beliefs play in the mathematical problem-solving of middle school gifted students (n = 66) mainstreamed with regular education students (n = 232) in algebra classes. Self-efficacy of gifted students made an independent contribution to the prediction of problem-solving in a model that controlled for the effects of math anxiety, cognitive ability, mathematics GPA, self-efficacy for self-regulated learning, and sex. Gifted girls surpassed gifted boys in performance but did not differ in self-efficacy. Gifted students reported higher math self-efficacy and self-efficacy for self-regulated learning as well as lower math anxiety than did regular education students. Although most students were overconfident about their capabilities, gifted students had more accurate self-perceptions and gifted girls were biased toward underconfidence. Results support the hypothesized role of self-efficacy in A. Bandura's (1986) social cognitive theory.