
979 So.2d 1004 (2008)
Elias SANCHEZ, Appellant,
v.
The STATE of Florida, Appellee.
No. 3D05-1321.
District Court of Appeal of Florida, Third District.
February 20, 2008.
Rehearing Denied April 25, 2008.
*1005 John H. Lipinski, for appellant.
Bill McCollum, Attorney General, Michele Samaroo and Laura Moszer, Assistant Attorneys General, for appellee.
Before COPE and LAGOA, JJ., and SCHWARTZ, Senior Judge.
COPE, J.
This is an appeal from an order denying a motion to correct illegal sentence under Florida Rule of Criminal Procedure 3.800(a). Defendant-appellant Elias Sanchez contends that he does not qualify for the agreed twenty-year mandatory minimum sentence imposed on him pursuant to the ten-twenty-life statute. We conclude that such a claim is not cognizable under rule 3.800(a).
The defendant was charged with multiple offenses arising out of a home invasion robbery.[1] According to the judgment, two of the offenses were life felonies on which the defendant could have received a life sentence.
The defendant entered into a plea agreement for a twenty-year sentence with a twenty-year minimum mandatory term pursuant to the ten-twenty-life statute. The factual basis for the plea was stated on the record. As to the twenty-year mandatory minimum sentence, the factual basis was as follows. During a struggle between the defendant and one of the victims, the defendant pulled the trigger of the pistol (either accidentally or intentionally) but it did not fire because the webbing between the victim's thumb and first finger was caught by the hammer of the pistol, thus preventing it from firing.
On February 4, 2002, the trial court conducted the plea colloquy and entered the sentencing order. The twenty-year mandatory minimum sentence was entered on counts one and two, both of which were life felonies, and count four, a first-degree felony. The twenty-year term and twenty-year mandatory minimum were, therefore, less than the legal maximum on those counts. The sentences imposed on counts one, two, and four were concurrent with each other.[2]
In July 2004, the defendant filed a motion to correct illegal sentence under Florida Rule of Criminal Procedure 3.800(a). The defendant argued that the facts stated in the plea colloquy are undisputed and that he does not qualify for the imposition of the twenty-year mandatory minimum *1006 sentence under the ten-twenty-life statute. The statute provides in part that there will be a twenty-year mandatory minimum sentence when, in the course of committing an enumerated felony, the defendant "discharged a `firearm' . . . as defined in s. 790.001. . . ." § 775.087(2)(a)2, Fla. Stat. (1999). For present purposes we assume, but do not decide, that "discharged" means that the firearm discharged a projectile. Under those facts, the twenty-year mandatory minimum sentence does not apply to this defendant.
The trial court denied the rule 3.800(a) motion in an order stating that a motion to correct illegal sentence cannot be used to attack the factual basis for a plea. In so doing, the court relied on Spates v. State, 700 So.2d 445 (Fla. 1st DCA 1997). The rule 3.800(a) motion could not be treated as a motion for postconviction relief under Florida Rule of Criminal Procedure 3.850 because the two-year time period for a rule 3.850 motion had expired. This Court affirmed without opinion. Sanchez v. State, 892 So.2d 1041 (Fla. 3d DCA 2004).
In 2005, the defendant retained counsel who filed another motion to correct illegal sentence. As amended, this motion reasserted the same ground, and also alleged that there was a violation of Apprendi v. New Jersey, 530 U.S. 466, 120 S.Ct. 2348, 147 L.Ed.2d 435 (2000). The trial court denied relief and the defendant has appealed.
This Court has held that a challenge to the factual basis for a plea must be brought under Florida Rule of Criminal Procedure 3.850 (which provides a two-year time limit), not rule 3.800(a) (which provides no time limit at all). See White v. State, 935 So.2d 554, 555 (Fla. 3d DCA 2006). The underlying logic is that if the defendant is to be relieved of his obligations under the plea bargain, that must occur within the two-year time limit of rule 3.850 so that there is a realistic possibility of proceeding to trial if the plea is set aside.
In White, the plea involved a burglary charge and did not involve a mandatory minimum sentence. However, the logic of White is applicable where, as here, the plea includes an agreed mandatory minimum sentence as well as an agreed sentence on the substantive offenses. So long as the sentences do not exceed the legal maximum (there is no such claim here), rule 3.800(a) cannot be employed to challenge the factual basis for a plea, including an agreed mandatory minimum sentence.
The Florida Supreme Court has held that rule 3.800(a) cannot be used to challenge the factual basis for a mandatory minimum sentence where resolution of the issue required an evidentiary determination. State v. Mancino, 705 So.2d 1379, 1381 (Fla.1998) (approving Young v. State, 616 So.2d 1133 (Fla. 3d DCA 1993)). Arguably the present case can be distinguished from Mancino and Young, because in the present case the factual basis for the imposition of the twenty-year mandatory minimum was stated on the face of the plea colloquy, and no fact finding is necessary. As already stated, however, under White a challenge to the factual basis for a plea must be brought under rule 3.850. Rule 3.800(a) is not available where, as here, none of the sentences exceeds the legal maximum.
The defendant's alternative argument is that there was an error under Apprendi v. New Jersey, 530 U.S. 466, 120 S.Ct. 2348, 147 L.Ed.2d 435 (2000). The decision in Apprendi is applicable where a sentence exceeds the legal maximum. 530 U.S. at 490, 120 S.Ct. 2348. A claim that a sentence exceeds the legal maximum is cognizable on a motion under Florida Rule of Criminal Procedure 3.800(a). The Apprendi *1007 claim is, however, without merit. The twenty-year mandatory minimum sentence is within the statutory maximum. See Apprendi, 530 U.S. at 490, 120 S.Ct. 2348; Balkcom v. State, 789 So.2d 949, 950 (Fla.2000). The Apprendi decision is also inapplicable in the case of a plea, where "the defendant either stipulates to the relevant facts or consents to judicial fact finding." Blakely v. Washington, 542 U.S. 296, 310, 124 S.Ct. 2531, 159 L.Ed.2d 403 (2004). In this case the defendant stipulated to the factual basis and to the imposition of this specific sentence.
Affirmed.[3]
NOTES
[1]  The crime date was June 30, 2000.
[2]  The trial court imposed fifteen-year concurrent terms on counts three and five, both of which are second degree felonies. Those counts are not placed in issue by the defendant's motion.
[3]  In the original sentencing proceeding the trial court suggested that the agreed twenty-year mandatory minimum sentence could be achieved by stacking two ten-year mandatory minimums under the ten-twenty-life statute. We need not reach that issue.
