
749 So.2d 545 (2000)
Ronald SNEED, Appellant,
v.
STATE of Florida, Appellee.
No. 98-2111.
District Court of Appeal of Florida, Fourth District.
January 5, 2000.
Richard L. Jorandby, Public Defender, and Ian Seldin, Assistant Public Defender, West Palm Beach, for appellant.
Robert A. Butterworth, Attorney General, Tallahassee, and Ettie Feistmann, Assistant Attorney General, West Palm Beach, for appellee.
WARNER, C.J.
A jury found appellant guilty of attempted possession of cocaine and possession of drug paraphernalia. Immediately after the verdict, the trial court adjudicated appellant guilty of both offenses, and thinking both charges were misdemeanors sentenced the appellant to time served with *546 the agreement of the state.[1] The next day the trial court vacated the judgment and sentence and subsequently held a hearing, because the court and the state were wrong in their conclusion that attempted possession of cocaine was a misdemeanor. In fact, it was a felony. At the second sentencing hearing, the trial court sentenced the appellant to 140.4 months in prison. Appellant claims that imposition of the second sentence constituted double jeopardy. We agree and reverse.
Although the appellant did not raise a double jeopardy challenge at the trial level to his resentencing, a violation of double jeopardy principles is fundamental error and may be raised for the first time on appeal. See Acosta v. State, 489 So.2d 63, 63 n. 1 (Fla. 4th DCA 1986)(citing State v. Johnson, 483 So.2d 420, 422 (Fla.1986)). In the instant case, the court adjudicated the appellant and sentenced him to time served. Thus, by the time the court realized its mistake, appellant's sentence had already been served. Moreover, where a sentence has already been served, even if it is an illegal sentence, the court lacks jurisdiction and would violate the Double Jeopardy Clause by resentencing the defendant to an increased sentence. See Palmer v. State, 182 So.2d 625, 626-27 (Fla. 4th DCA 1966); cf. United States v. Silvers, 90 F.3d 95, 101 (4th Cir.1996). In Palmer, this court quoted with approval from 8 R.C.L., Criminal Laws, § 247 that:
"Where a judgment has been fully satisfied by the defendant, the trial court has no power to amend it by increasing the punishment after the term at which the judgment was rendered, or even during the same term. The ends of justice will not be served by permitting the state, after the sentence of the law has been discharged, to open the case for any purpose and least of all to insert an additional penalty. To permit this would be like punishing the delinquent the second time for the same offense."
182 So.2d at 626 (emphasis added). In a footnote we also noted that an invalid sentence that has been served will not be set aside, because the question has become moot. See id. at 626 n. 2.
We therefore reverse and remand for the trial court to vacate the second sentence and to discharge the defendant from custody on that charge. He, of course, remains in custody on his other judgment and sentence.
DELL and GUNTHER, JJ., concur.
NOTES
[1]  The record reflects that appellant had also been convicted of another crime for which he was already serving a fifteen year sentence.
