Charlie Robinson, a Florida prisoner, appeals pro se the sua sponte dismissal of his complaint, see 42 U.S.C. § 1983, that various employees of the Florida Department of Corrections, the Florida Parole Commission, and the Tomoka Correctional Institution, violated Robinson’s rights under the Eighth and Fourteenth Amendments when they forfeited all or part of Robinson’s “gain time” following the revocation of his control release. We affirm.
We review de novo the sua sponte dismissal by a district court for failure to state a claim, see 28 U.S.C. § 1915(e)(2)(B)(ii), and view the allegations in the complaint as true. Hughes v. Lott, 350 F.3d 1157, 1159-60 (11th Cir.2003).
A habeas petition is the “exclusive remedy for a prisoner who challenges the fact or duration of his confinement and seeks immediate or speedier release.” Preiser v. Rodriguez, 411 U.S. 475, 500, 93 S.Ct. 1827, 1841, 36 L.Ed.2d 439 (1973). “[A] state prisoner’s [section] 1983 action is barred (absent prior invalidation)—no matter the relief sought (damages or equitable relief), no mater the target of the prison*239er’s suit (state conduct leading to conviction or internal prison proceedings)—if success in that action would necessarily demonstrate the invalidity of confinement or its duration.” Wilkinson v. Dotson, 544 U.S. 74, 82, 125 S.Ct. 1242, 1248, 161 L.Ed.2d 253 (2005) (emphasis in original). Robinson challenges the computation of his gain time by the Florida Department of Corrections. The allocation of gain time has a direct effect on the duration of a prisoner’s confinement. The district court correctly concluded that Robinson’s exclusive remedy is a habeas petition.
The dismissal of Robinson’s complaint is
AFFIRMED.