
699 P.2d 110 (1985)
Richard T. EDGAR, Appellant,
v.
Richard WAGNER, Respondent.
No. 16002.
Supreme Court of Nevada.
May 8, 1985.
*111 Rupert C. Schneider, Battle Mountain, for appellant.
Charles W. Spann, Reno, for respondent.

OPINION
PER CURIAM:
Appellant Richard T. Edgar brought this action against respondent District Attorney Richard Wagner and others under 42 U.S.C. § 1983, seeking damages for deprivation of due process caused by his arrest, incarceration, a prosecution against him and a newspaper publication of the arrest. Appellant was arrested, incarcerated and charged for violating fish and game laws; when an error in his identification was discovered, the charges against appellant were dismissed and the newspaper corrected the report of the arrest.
Appellant alleged in the complaint that respondent assisted an agent of the Nevada Department of Wildlife in the preparation of an affidavit supporting the issuance of a warrant for appellant's arrest and "... . [t]he contents of said affidavit ... demonstrate malice, a structured deprivation of due process in violation of 42 U.S.C.S. § 1983, and under the laws of Nevada, a malicious prosecution and false arrest." The district court dismissed the action on the ground it failed to state a claim upon which relief could be granted because the preparation of the affidavit was a prosecutorial function and respondent therefore was immune from liability for damages. NRCP 12(b).
On appeal, appellant contends the district court erred in dismissing the case because the complaint alleged facts which could entitle appellant to relief. We agree.
On review of a motion to dismiss, our task is to determine whether or not the challenged pleading sets forth allegations sufficient to make out the elements of a right to relief. Crucil v. Carson City, 95 Nev. 583, 600 P.2d 216 (1979); cf. Stump v. Sparkman, 435 U.S. 349, 354, 98 S.Ct. 1099, 1103, 55 L.Ed.2d 331 (1978). In making this determination, the allegations in the complaint must be taken at "face value," California Motor Transport Co. v. Trucking Unlimited, 404 U.S. 508, 515, 92 S.Ct. 609, 614, 30 L.Ed.2d 642 (1972), and *112 must be construed favorably in the plaintiff's behalf. The complaint cannot be dismissed for failure to state a claim unless it appears beyond a doubt that the plaintiff could prove no set of facts which, if accepted by the trier of fact, would entitle him to relief. Conley v. Gibson, 355 U.S. 41, 45-46, 78 S.Ct. 99, 101-02, 2 L.Ed.2d 80 (1957).
The resolution of the motion to dismiss turned upon the scope and application of Imbler v. Pachtman, 424 U.S. 409, 428, 96 S.Ct. 984, 994, 47 L.Ed.2d 128 (1976). In that case, the Supreme Court held that state prosecutors were immune from liability where the acts complained of were "intimately associated with the judicial phase of the criminal process." Id. at 430-431, 96 S.Ct. at 994-995; see also County of Washoe v. District Court, 98 Nev. 456, 652 P.2d 1175 (1982). A prosecutor who functions primarily as an administrator or investigator is accorded qualified immunity, that is, protection from liability depends upon a showing that the prosecutor entertained a good faith, reasonable belief in actions taken in an administrative or investigative capacity. See Beard v. Udall, 648 F.2d 1264, 1271 (9th Cir.1981); Briggs v. Goodwin, 569 F.2d 10, 16 (D.C.Cir.1977); Stevens v. McGimsey, 99 Nev. 840, 673 P.2d 499 (1983).[1]
Assuming, as we must at this juncture, respondent participated in the preparation of the affidavit with malice, and in a deliberately structured effort to deprive appellant of due process, the allegations of the complaint state a claim which, if accepted by the trier of fact, could entitle appellant to relief. The district court erred in concluding such an act was a prosecutorial function cloaked with absolute immunity. Respondent cites no direct authority for the contention that the behavior at issue here falls within the scope of the absolute immunity endorsed by Imbler. We are persuaded that prosecutors will not be adversely affected in their discharge of public duties by the application of the qualified immunity where the allegations suggest malicious prosecution.
Accordingly, the order of the district court is reversed and the case remanded for further proceedings in accordance with this opinion.
NOTES
[1]  The legislature has codified some aspects of common law immunity in NRS 41.032, which provides in pertinent part:

No action may be brought under NRS 41.031 or against an officer or employee of the state or any of its agencies or political subdivisions which is:
1... .
2. Based upon the exercise or performance or the failure to exercise or perform a discretionary function or duty on the part of the state or any of its agencies or political subdivisions or of any officer or employee of any of these, whether or not the discretion involved is abused.
