2 F.3d 1156
NOTICE: Ninth Circuit Rule 36-3 provides that dispositions other than opinions or orders designated for publication are not precedential and should not be cited except when relevant under the doctrines of law of the case, res judicata, or collateral estoppel.Terry Lee BARKER, Plaintiff-Appellant,v.Deborah Michelle BOWERS, Defendant-Appellee.
No. 92-36884.
United States Court of Appeals, Ninth Circuit.
Submitted June 25, 1993.*Decided July 8, 1993.

Before CANBY, FERNANDEZ and T.G. NELSON, Circuit Judges.


1
MEMORANDUM**


2
Terry L. Barker appeals pro se the district court's dismissal of his 42 U.S.C. Sec. 1983 action as frivolous pursuant to 28 U.S.C. Sec. 1915(d).  We have jurisdiction pursuant to 28 U.S.C. Sec. 1291.  We review for abuse of discretion.  Denton v. Hernandez, 112 S.Ct. 1728, 1734 (1992).  We affirm in part, we vacate in part, and remand.


3
The district court may dismiss a complaint filed in forma pauperis before service of process if the court finds the complaint is frivolous.  28 U.S.C. Sec. 1915(d);  Jackson v. Arizona, 885 F.2d 639, 640 (9th Cir.1989).  A complaint is frivolous if it "lacks an arguable basis either in law or in fact."  Neitzke v. Williams, 490 U.S. 319, 325 (1989).  Pro se civil rights complaints are liberally construed.  Lopez v. Department of Health Servs., 939 F.2d 881, 883 (9th Cir.1991).


4
When a prisoner challenges the fact or duration of his confinement, his sole federal remedy is a writ of habeas corpus.  Badea v. Cox, 931 F.2d 573, 574 (9th Cir.1991);  Young v. Kenny, 907 F.2d 874, 875 (9th Cir.1990), cert. denied, 111 S.Ct. 1090 (1991).  "[H]abeas must be the exclusive federal remedy not just when a state prisoner requests the invalidation ... of his sentence, but whenever the relief requires as its predicate a determination that a sentence currently being served is invalid."  Young, 907 F.2d at 876.  This is true even when the complaint seeks money damages only.  Preiser v. Rodriguez, 411 U.S. 475, 489-90 (1973).


5
When a prisoner's complaint seeks relief available only under habeas, the district court should construe the complaint to the extent possible as a habeas petition.  Franklin v. Oregon, 662 F.2d 1337, 1347 n. 13 (9th Cir.1981).  A state prisoner may not obtain habeas corpus relief until he exhausts all available state court remedies.  Keeny v. Tamayo-Reyes, 112 S.Ct. 1715, 1720 (1992).  If the prisoner has failed to exhaust his state remedies before requesting relief in the federal courts, then the district court should dismiss without prejudice the prisoner's habeas claim.  Ybarra v. Reno Thunderbird Mobile Home Village, 723 F.2d 675, 681-82 (9th Cir.1984).


6
Ordinarily, when a prisoner files a civil rights complaint seeking only monetary relief but raising constitutional issues that directly relate to the legality or duration of his confinement, the district court should stay, rather than dismiss, the claim for damages pending the exhaustion of the prisoner's state law remedies.  Young, 907 F.2d at 878.  Such a stay ensures that the statute of limitations on the damages claim does not expire while the prisoner exhausts his state remedies.  Id.


7
Here, Barker's complaint seeks monetary damages from Deborah M. Bowers.1  The complaint alleges that Bowers testified falsely under oath in Barker's criminal trial and that Bowers' testimony contributed to Barker's wrongful prosecution.  Thus, it is clear that the basis of Barker's claim is a challenge to the constitutionality of his confinement.  See Ybarra, 773 F.2d at 682.  Accordingly, the district court properly construed Barker's complaint as a habeas claim.  Because Barker failed to allege he had exhausted his state remedies, the district court properly dismissed Barker's habeas claim.  See id. at 681-82.  The district court erred, however, by dismissing Barker's habeas claim with prejudice.  See Rose v. Lundy, 455 U.S. 509, 522 (1982);  Guizar v. Estelle, 843 F.2d 371, 372 (9th Cir.1988) (prisoners should have the option of resubmitting petition;  thus, petition containing unexhausted claims should be dismissed without prejudice).


8
Nevertheless, even if Barker is entitled to habeas relief, the district court properly dismissed Barker's claim against Bowers because Bowers is immune from suit.  Witnesses are absolutely immune from liability for damages under section 1983 for perjured testimony given in criminal trials.  Briscoe v. LaHue, 460 U.S. 325, 334, cert. denied, 460 U.S. 1037 (1983);  Babcock v. Tyler, 884 F.2d 497, 501 (9th Cir.1989), cert. denied, 493 U.S. 1072 (1990).  Because Barker seeks monetary damages based on Bowers' alleged false testimony, Bowers is immune from suit under section 1983.  See Briscoe, 460 U.S. at 334.


9
Accordingly, the district court properly dismissed with prejudice Barker's section 1983 claim pursuant to 28 U.S.C. Sec. 1915(d), but improperly dismissed with prejudice Barker's habeas claim.


10
AFFIRMED IN PART, VACATED IN PART, AND REMANDED with instructions to modify the judgment to show the habeas corpus claim was dismissed without prejudice.



*
 The panel unanimously finds this case suitable for decision without oral argument.  Fed.R.App.P. 34(a);  9th Cir.R. 34-4


**
 This disposition is not appropriate for publication and may not be cited to or by the courts of this circuit except as provided by 9th Cir.R. 36-3


1
 Bowers was the alleged victim of rape and sodomy, for which Barker was tried and convicted


