
410 So.2d 636 (1982)
STATE of Florida, Appellant,
v.
Walker Franklin IVEY, Appellee.
No. 81-1374.
District Court of Appeal of Florida, Second District.
March 5, 1982.
Jim Smith, Atty. Gen., Tallahassee, Samuel R. Mandelbaum and James S. Purdy, Asst. Attys. Gen., Tampa, for appellant.
Richard D. Mars, Lakeland, for appellee.
RYDER, Judge.
The state appeals from the order granting discharge to appellee under the speedy trial provisions of the interstate agreement on detainers compact. We hold that the lower court erred in finding appellee to have been able to stand trial, and we reverse.
The state charged appellee with failure to appear after being released on bond for a controlled substance charge. Since appellee was imprisoned in the Federal Correctional Institution in Miami, the state on December 16, 1981 filed with that institution a request for temporary custody to obtain the presence of appellee. Appellee also signed a request for disposition of the same charges on December 16, 1980.
Appellee was placed in custody of the state on January 13, 1981. On March 19, 1981, a U.S. Magistrate in the Southern District of Florida issued a writ of habeas corpus ad testificandum directing that appellee be taken to Ft. Lauderdale to testify before a federal grand jury by March 30. Although the writ directed the return of appellee with all convenient speed to the Polk County authorities on completion of the testimony, federal marshals instead transported appellee back to the Federal *637 Correctional Institution in Miami. The state issued a writ of habeas corpus ad prosequendum on April 24 to obtain the return of appellee, and set trial for June 4. Appellee's motion for discharge was filed and granted on June 1, the court finding that he had been in custody for more than 120 days.
Because the state initiated the procedure against appellee by transmitting to the Federal Institution a request for custody pursuant to section 941.45(4)(a), Florida Statutes (1979), the state was required to commence trial within 120 days after arrival of the prisoner. Section 941.45(4)(c), Florida Statutes (1979). This period expired on May 13, 1981, and appellee would ordinarily be entitled to discharge after that date if trial had not commenced.
We hold that the lower court erred in finding that appellee was able to stand trial for the entire 120-day period. Section 941.45(6)(a), Florida Statutes (1979) provides:
In determining the duration and expiration dates of the time periods provided in subsections (3) and (4), the running of said time periods shall be tolled whenever and for as long as the prisoner is unable to stand trial, as determined by the court having jurisdiction of the matter.
During the time period when appellee was required by federal authorities to return to give testimony and the later delay when federal marshals transported appellee back to the Federal Correctional Institution, appellee was unable to stand trial in the Tenth Judicial Circuit Court. Thus, the tolling provisions of section 941.45(6)(a) came into effect, and the 120-day period specified by section 941.45(4)(c) was extended. It appears from the record before us that federal marshals took appellee from Polk authorities on March 27, 1981, and returned him on May 5, 1981, a period of thirty-nine days. The 120-day period was thus extended until June 21, 1981. Appellee's motion for discharge filed on June 1, 1981 should have been denied by the court below.
The order below is REVERSED and the case REMANDED for further proceedings.
BOARDMAN, A.C.J. and GRIMES, J., concur.
