
436 So.2d 342 (1983)
Charles Henry ELLIS, Appellant,
v.
STATE of Florida, Appellee.
No. AP-251.
District Court of Appeal of Florida, First District.
August 12, 1983.
*343 Terry P. Lewis, Sp. Asst. Public Defender, Tallahassee, for appellant.
Wallace E. Allbritton, Asst. Atty. Gen., Tallahassee, for appellee.
THOMPSON, Judge.
Defendant appeals his judgment and sentence for attempted sexual battery. Defendant argues that his six-year term of incarceration, imposed after he violated the terms and conditions of his Community Control Release Agreement as defined in the Youthful Offender Act, Chapter 958, Florida Statutes (1979), is contrary to the mandatory sentencing provisions of the Youthful Offender Act. We agree and reverse.
Defendant was classified as a youthful offender with regards to a 1979 attempted sexual battery. After being adjudicated guilty of this crime, he was sentenced to six years at the Alachua County Adult Corrections Center, with the provision that after serving one year, the remainder of his sentence would be stayed and withheld and he would be placed on five years probation. While defendant was on probation after release from the correctional center, an affidavit of violation of probation was filed, alleging he had violated the terms of his probation by, inter alia, committing burglary and two counts of grand theft. Defendant entered a negotiated plea, admitting he had violated the terms and conditions of his probation, in exchange for the state's agreement to nolle pross the burglary and grand theft charges. The trial court subsequently revoked defendant's probation and imposed a six-year sentence with 436 days credit. Defense counsel correctly argued below that pursuant to the mandatory sentencing provisions of § 958.05, Fla. Stat. defendant could only be sentenced to a maximum of four years incarceration, with appropriate jail credit, and to a maximum of two years of community control but the maximum two years of community control could not be added to the maximum four years of incarceration to yield a six-year term of incarceration. However, the trial court construed § 958.05 as not imposing a four-year maximum period of incarceration.
The trial court's interpretation of the sentencing provisions of § 958.05 is erroneous. Once a defendant is classified as a youthful offender, he must be sentenced in accordance with the act. See Waugh v. State, 406 So.2d 1238 (Fla. 2d DCA 1981). This also applies to sentences, such as the one herein, entered pursuant to a subsequent revocation of probation. See Brandle v. State, 406 So.2d 1221 (Fla. 4th DCA 1982); Greene v. State, 398 So.2d 1011 (Fla. 1st DCA), pet. for rev. dismissed, 406 So.2d 1118 (Fla. 1981). Since defendant was originally classified as a youthful offender regarding the attempted sexual battery, his sentence for attempted sexual battery which was imposed upon revocation of probation for that offense should have been in accordance with the provisions of § 958.05.
The state cites Preston v. State, 411 So.2d 297 (Fla. 3d DCA), pet. for rev. den., 418 So.2d 1280 (Fla. 1982) for the proposition that defendant has waived the right to challenge the instant sentence because he did not challenge his original sentence for attempted sexual battery, which was clearly an improper sentence under § 958.05. However, Preston, which involved an appeal from an order denying a motion to correct a sentence imposed after revocation of probation, is clearly distinguishable from the instant case. The defendant's argument in Preston that he could only be sentenced upon revocation of probation, as a youthful offender because he was originally entitled to designation as a youthful offender was rejected because he had never sought designation as a youthful offender and because he had not been sentenced to imprisonment but had been placed on probation. The defendant in the case sub judice sought and was granted designation as a youthful offender. This defendant was actually sentenced to a term of imprisonment, which he apparently served before being released on *344 probation. Accordingly, Preston does not require rejection of the defendant's argument.
The sentence imposed herein is reversed and the cause is remanded for resentencing consistent with the provisions of § 958.05. Defendant shall be given appropriate credit for the time he has already served.
ERVIN, C.J., and WIGGINTON, J., concur.
