
    Richard Otto HANSEN, Appellant, v. Timothy SCHMIDT, In His Official Capacity As The District Attorney Of Nuckolls County, Nebraska; Terri Harder, In Her Official Capacity As The District Judge Of Nuckolls County, Nebraska, Appellees.
    No. 07-1095.
    United States Court of Appeals, Eighth Circuit.
    Submitted: Oct. 2, 2007.
    Filed: Oct. 23, 2007.
    Richard Otto Hansen, Springfield, MO, pro se.
    Before WOLLMAN, COLLOTON, and BENTON, Circuit Judges.
    [UNPUBLISHED]
   PER CURIAM.

Federal inmate Richard Otto Hansen appeals the district court’s preservice dismissal, without prejudice, of his 42 U.S.C. § 1983 action under 28 U.S.C. §§ 1915(e)(2)(B) and 1915A(b). Having carefully reviewed the record and Hansen’s submissions on appeal, see Moore v. Sims, 200 F.3d 1170, 1171 (8th Cir.2000) (per curiam) (standard of review under § 1915(e)(2)(B)); Cooper v. Schriro, 189 F.3d 781, 783 (8th Cir.1999) (per curiam) (standard of review under § 1915A(b)), we affirm.

We agree with the district court that both defendants are immune from a civil suit for damages. See Mireles v. Waco, 502 U.S. 9, 11-12, 112 S.Ct. 286, 116 L.Ed.2d 9 (1991) (per curiam) (judicial immunity); Brodnicki v. City of Omaha, 75 F.3d 1261, 1266 (8th Cir.1996) (prosecutorial immunity). We also agree with the district court that Hansen’s complaint fails because Hansen seeks to vacate a state criminal conviction, and such actions must be brought through a petition for a writ of habeas corpus rather than a section 1983 complaint. See Preiser v. Rodriguez, 411 U.S. 475, 500, 93 S.Ct. 1827, 36 L.Ed.2d 439 (1973) (federal writ of habeas corpus is sole remedy for challenges to fact or duration of confinement).

The judgment of the district court is affirmed. 
      
      . The Honorable Richard G. Kopf, United States District Judge for the District of Nebraska.
     