
    Richard HEDRICK, a/k/a Richard Hendrick, Appellant, v. The STATE of Florida, Appellee.
    No. 88-1311.
    District Court of Appeal of Florida, Third District.
    May 30, 1989.
    Stephen N. Bernstein and Stephany S. Carr, Gainesville, for appellant.
    Robert A. Butterworth, Atty. Gen., and Charles M. Fahlbusch, Asst. Atty. Gen., for appellee.
    Before NESBITT and FERGUSON, JJ., and HERBOTH S. RYDER, Associate Judge.
   HERBOTH S. RYDER, Associate Judge.

This appeal arises from the trial court’s denial of appellant’s motion to correct sentence. We affirm.

On June 3, 1984, appellant was arrested and charged with second-degree murder. While in custody, he was further charged with two counts of battery against a law enforcement officer. - On September 26, 1984, appellant was adjudged incompetent to stand trial and was sent to the Florida State Hospital at Chattahoochee. He remained at Chattahoochee for two years and three months and was then transferred to the Dade County jail. After approximately two months in jail, appellant was deemed competent.

On February 6, 1987, the parties entered into a plea agreement in which they stipulated that appellant was not guilty by reason of insanity on the second-degree murder charge and appellant pleaded nolo con-tendere to the two counts of battery against a law enforcement officer. Appellant agreed to be placed on three years’ probation, with the special condition that he serve three years of detention in a secure mental health facility. If released or transferred from such a facility for any reason prior to the end of the three years, he agreed to serve the balance of the three years in jail. Appellant also agreed not to “seek early termination ... from either the State Hospital or from probation.”

About one year later, appellant filed his motion to correct sentence, maintaining that section 921.161(1), Florida Statutes (1987), and the supreme court’s recent decision in Tal-Mason v. State, 515 So.2d 738 (Fla.1987), required that he be given credit for the entire time he spent in custody while incompetent to stand trial, which amounts to two years and five months, against the incarceration that was a special condition of his probation. A hearing was held and the trial court denied the motion, ruling that the three years required as a special condition of probation began on February 6, 1987 and that appellant had waived credit for time served and gain time. This appeal timely ensued.

We have reviewed the record and find that no error was committed. The plea agreement was fully explained to appellant in open court and his response indicates he was fully cognizant that he was expressly waiving his right to seek early release from his three years of detention, by appeal or otherwise. Further, appellant used his nolo plea and his promise to abide by the special conditions of his probation as a lever to extract from the state its agreement to nol-pros the second-degree murder charge. We will hold appellant to his bargain.

Affirmed.  