*531MEMORANDUM AND ORDER
SAFFELS, Senior District Judge.Plaintiff proceeds pro se and in for-ma pauperis on a complaint filed pursuant to 42 U.S.C. § 1983. Plaintiff complains that he was denied a fair trial and names as defendants the state district court judge and the prosecuting attorney. Plaintiff seeks to have his criminal conviction reversed, and a new trial ordered. He also seeks copies of his trial transcript and appointment of counsel.
The court finds it appropriate to dismiss the complaint. Section 1983 is not a substitute for a habeas action. When a prisoner seeks to challenge the length or fact of his confinement, he must pursue his claim through writ of habeas corpus, 28 U.S.C. § 2254 after first exhausting state court remedies on his allegations of constitutional error. Preiser v. Rodriguez, 411 U.S. 475, 93 S.Ct. 1827, 36 L.Ed.2d 439 (1973).
Plaintiff is further advised that both defendants would be entitled to absolute immunity from liability under § 1983. See Dennis v. Sparks, 449 U.S. 24, 27, 101 S.Ct. 183, 186, 66 L.Ed.2d 185 (1980) (judges defending against 1983 actions enjoy absolute immunity from damages liability for acts performed in judicial capacity); Cleavinger v. Saxner, 474 U.S. 193, 106 S.Ct. 496, 88 L.Ed.2d 507 (1985) (prosecutors have absolute immunity when carrying out prosecutorial functions).
IT IS THEREFORE ORDERED that the complaint is dismissed.