
66 P.3d 316 (2003)
2003 MT 62
Douglas L. PLOUFFE, Plaintiff and Appellant,
v.
STATE of Montana, Department of Justice, Gambling Control Division, Department of Public Health and Human Services, Department of Environmental Quality and John Does, I Through XX, Defendants and Respondents.
No. 01-829.
Supreme Court of Montana.
Submitted on Briefs October 17, 2002.
Decided March 28, 2003.
*317 Douglas L. Plouffe (pro se), Chinook, Montana, for Appellant.
Roger T. Witt, Ugrin, Alexander, Zadick & Higgins, Great Falls, Montana, for Respondents.
Justice TERRY N. TRIEWEILER delivered the Opinion of the Court.
¶ 1 The Plaintiff, Douglas Plouffe, brought this action in the District Court for the Seventeenth Judicial District in Blaine County, in which he alleged that Defendants, the State of Montana and several of its agencies, damaged him by tortious conduct, including malicious prosecution and defamation. Defendants filed a motion to dismiss based on principles of res judicata. The District Court granted Defendants' motion to dismiss, and Plouffe appeals that order. We reverse the order of the District Court.
¶ 2 The sole issue on appeal is whether the District Court erred when it granted the Defendants' motion to dismiss.

FACTUAL AND PROCEDURAL BACKGROUND
¶ 3 Douglas Plouffe is the sole shareholder of Sleeping Buffalo Management, Inc., which owned and operated Sleeping Buffalo Resort, a recreation facility near Malta, Montana, from 1988 through 1999. During the course of the operation of that resort, Plouffe was cited by the Defendants for violations related to the operation of gaming machines. These citations apparently caused Plouffe to eventually lose his license to operate gaming machines, and his business subsequently closed.
¶ 4 On May 18, 2001, Plouffe filed a pro se fifteen-page complaint in the District Court, naming as defendants the State of Montana, Department of Justice, Gambling Control Division, *318 Department of Environmental Quality and John Does I through XX. Plouffe alleged that the Defendants "knowingly, purposely, and/or negligently committed these tortious acts against the Plaintiff," and as a result damaged him in his capacity as sole stockholder and owner of Sleeping Buffalo Management, Inc., and Sleeping Buffalo Resort. He alleged various specific violations of his rights, including his rights to due process of law and equal protection of the law. He also alleged several tort claims, including defamation, negligence and outrageous governmental conduct. For each claim Plouffe alleged specific facts in support. The Defendants did not file a motion pursuant to Rule 12(e), M.R.Civ.P., for a more definite statement.
¶ 5 On July 16, 2001, the Defendants filed a motion to dismiss Plouffe's complaint pursuant to Rule 12(b)(6), M.R.Civ.P. Defendants submitted a brief in support of their motion to dismiss, in which they contended that the current suit was barred by principles of res judicata. To support their motion, Defendants cited to several prior causes of action brought by Plouffe and adjudicated in Defendants' favor. Plouffe filed a response on August 6, 2001, in which he distinguished the current case from the prior cases. On August 23, 2001, Defendants filed a reply brief, and attached with it 151 pages of exhibits, which included pleadings and orders from the cases referred to in their initial brief in support of their motion to dismiss.
¶ 6 On August 30, 2001, Plouffe filed a reply to Defendants' reply brief, which stated in part: "[t]he defendants has [sic] attached several exhibits to their reply brief, as their motion was not a motion for Summary Judgment, their exhibits are outside of the pleadings and should not be considered." The reply further responded to Defendants' arguments raised in their reply brief.
¶ 7 On September 18, 2001, the District Court issued its Order on Motion to Dismiss, and granted Defendants' motion to dismiss Plouffe's complaint.

STANDARD OF REVIEW
¶ 8 We review de novo a district court's ruling on a motion to dismiss pursuant to Rule 12(b)(6), M.R.Civ.P. Powell v. Salvation Army (1997), 287 Mont. 99, 102, 951 P.2d 1352, 1354. "A motion to dismiss under Rule 12(b)(6), M.R.Civ.P., has the effect of admitting all well-pleaded allegations in the complaint. In considering the motion, the complaint is construed in the light most favorable to the plaintiff, and all allegations of fact contained therein are taken as true." Willson v. Taylor, 194 Mont. 123, 126-27, 634 P.2d 1180, 1182 (citations omitted). We will affirm the District Court's dismissal when we conclude that the plaintiff would not be entitled to relief based on any set of facts that could be proven to support the claim. Grove v. Montana Army Nat. Guard (1994), 264 Mont. 498, 501, 872 P.2d 791, 793. The determination whether a complaint states a claim is a conclusion of law, and the District Court's conclusions of law are reviewed for correctness. Boreen v. Christensen (1994), 267 Mont. 405, 408, 884 P.2d 761, 762.

DISCUSSION
¶ 9 Did the District Court err when it granted Defendants' motion to dismiss?
¶ 10 The District Court found that it was appropriate to dismiss Plouffe's complaint because principles of res judicata applied and stated that "[t]hese causes of action, claims for damages, and prayers for relief are verbatim those set forth in [Plouffe's] original Complaint of February 25, 1998. Complaint and Demand For Jury Trial, Cause No. DV-98-055, pages 15-16." The District Court acknowledged Rule 12(b)(6), M.R.Civ.P., but cited to our decision in Glickman v. Whitefish Credit Union Ass'n, 1998 MT 8, 287 Mont. 161, 951 P.2d 1388, to support its conclusion that "[a] Motion to Dismiss under this Rule is particularly appropriate when the issue of res judicata is presented to the Court." From the District Court's order, it is apparent that the District Court considered the exhibits attached to Defendants' reply brief particularly the exhibits related to Cause No. DV-98-055.
¶ 11 Plouffe contends that the District Court erred when it granted Defendants' motion to dismiss in reliance on materials other than his complaint. Plouffe acknowledges that the District Court could have *319 considered those exhibits by converting Defendants' motion to a motion for summary judgment; however, Plouffe contends that in that event, he would have been entitled to proper notice of the court's intention to do so as required by Rule 12(b), M.R.Civ.P.
¶ 12 Defendants contend that the District Court did not err because it was entitled to take judicial notice of the previous judgment pursuant to Rule 201, M.R.Evid., without converting the motion to one for summary judgment. Defendants further contend that to the extent there was error, it was harmless and that Plouffe waived his objection to the additional exhibits by responding to Defendants' reply brief.
¶ 13 We have recognized that "[a] motion to dismiss under Rule 12(b)(6), M.R.Civ. P., allows the District Court to only examine whether `a claim has been adequately stated in the complaint.'" Hoveland v. Petaja (1992), 252 Mont. 268, 270, 828 P.2d 392, 393, (quoting Gebhardt v. D.A. Davidson & Co. (1983), 203 Mont. 384, 389, 661 P.2d 855, 857.) Furthermore, the District Court's examination is limited to the content of the complaint. Hoveland, 252 Mont. at 270, 828 P.2d at 393 (citing Gebhardt, 203 Mont. at 389, 661 P.2d at 857). "The effect of such a motion is admitting to all the well pleaded allegations in the complaint and it should not be dismissed `unless it appears beyond a reasonable doubt that the plaintiff can prove no set of facts which would entitle him to relief.'" Hoveland, 252 Mont. at 270-71, 828 P.2d at 393 (quoting Gebhardt, 203 Mont. at 389, 661 P.2d at 858).
¶ 14 In this case it is clear that the District Court considered matters in addition to Plouffe's complaint, including the exhibits attached to the Defendants' reply brief. Whether, in fact, Plouffe's complaint was barred by principles of res judicata, as the District Court concluded, could not be determined by examining the allegations in the complaint and assuming them to be true. It could only be determined by considering pleadings from other proceedings, court decisions and records of administrative proceedings, and then comparing them to the allegations and parties in this complaint.
¶ 15 Before principles of res judicata bar a cause of action, four factors must be considered: the identity of the current and previous parties; the subject matter of the current and prior claim; the identity of the current and previous issues; and the capacity of the current and previous parties with regard to the subject matter and issues. See Grenz v. Fire & Cas. of Connecticut, 2001 MT 8, ¶ 14, 304 Mont. 83, ¶ 14, 18 P.3d 994, ¶ 14. Those facts could not be determined from the allegations of Plouffe's complaint. The Defendants were obviously aware of that problem when, on August 23, 2001, they filed a reply brief in support of their motion to which they attached 151 pages of exhibits. At that point, the District Court could have either ignored the Defendants' exhibits and decided the Defendants' motion based on the rules that pertain to motions to dismiss (which would have required denial of the motion), or it could have converted Defendants' motion to a motion for summary judgment pursuant to Rule 12(b), M.R.Civ.P. Rule 12(b), M.R.Civ.P. provides:
If, on a motion asserting the defense numbered (6) to dismiss for failure of the pleading to state a claim upon which relief can be granted, matters outside the pleading are presented to and not excluded by the court, the motion shall be treated as one for summary judgment and disposed of as provided in Rule 56, and all parties shall be given reasonable opportunity to present all material made pertinent to such motion by Rule 56. [Emphasis added.]
We have recognized that when the District Court converts a motion to dismiss to a motion for summary judgment, as contemplated by Rule 12(b), M.R.Civ.P., the District Court must provide notice to the parties of its intention to do so. Hoveland, 252 Mont. at 271, 828 P.2d at 393; State ex rel. Dept. of H. & E.S. v. City of Livingston (1976), 169 Mont. 431, 436, 548 P.2d 155, 157. "The purpose of notice is to allow the parties a reasonable opportunity to present all material made pertinent to the motion and avoid surprise." Hoveland, 252 Mont. at 271, 828 P.2d at 393-94. This includes an "opportunity to produce additional facts by affidavit or otherwise which would create a genuine issue *320 of material fact to preclude summary judgment under Rule 56, M.R.Civ.P." Hoveland, 252 Mont. at 271, 828 P.2d at 394 (citation omitted). We conclude that the District Court erred when it failed to provide notice to Plouffe of its intention to consider materials outside of Plouffe's pleading and convert Defendants' motion to dismiss to a motion for summary judgment.
¶ 16 We decline to make an exception for facts such as those in this case which may be judicially noticed. Judicial notice in this matter involves taking notice of "matters outside the pleading," as explained in Rule 12(b), M.R.Civ.P. The rule expressly mandates that in such an event all parties should have an opportunity to present additional evidence. Judicial notice cannot circumvent the notice requirement in Rule 12(b), M.R.Civ.P., in this case.
¶ 17 We also note that this decision is not inconsistent with our decision in Glickman. In Glickman, we affirmed a District Court's order granting a defendant's Rule 12(b)(6), M.R.Civ.P., motion on the grounds that the cause of action was barred by principles of res judicata. Glickman, ¶ 21. However, in Glickman, the plaintiff's complaint was a collateral attack on previous actions to quiet title and an action for a declaratory judgment "regarding the validity of the judgments, decrees of foreclosure, and the sheriff's sales" of the subject property. Glickman, ¶ 8, 951 P.2d 1388. Plouffe's complaint does not challenge or present a collateral attack on a prior judgment, but makes factual allegations of tortious conduct by the Defendants. Under these circumstances, the District Court could not dismiss Plouffe's complaint without first converting the Defendants' motion to a motion for summary judgment. The District Court's failure to do so, and failure to provide notice to Plouffe of its intent to do so, was error.
¶ 18 Finally, it is not correct that Plouffe acquiesced in the procedural irregularity which is the subject of his appeal. In response to the Defendants' motion to dismiss, Plouffe filed a brief in which he argued that for purposes of the Defendants' motion, the allegations in his complaint had to be taken as true and that the facts relied on by the Defendants are not admitted for purposes of a motion to dismiss. In response to the Defendants' reply brief and 151 pages of extraneous documentation, Plouffe argued as follows:
The Defendants have attached several exhibits to their reply brief, as their motion was not a motion for summary judgment, their exhibits are outside of the pleadings and should not be considered.
¶ 19 In spite of the fact that he was a pro se litigant without the benefit of legal advice, Plouffe could not have more properly objected to the District Court's consideration of the Defendants' 151 pages of extraneous documentation than he did in response to the Defendants' reply brief. Procedurally, Plouffe did everything correctly.
¶ 20 For the foregoing reasons, the District Court's Order on Motion to Dismiss is reversed and remanded for further proceedings consistent with this Opinion.
We Concur: W. WILLIAM LEAPHART, PATRICIA COTTER, JIM REGNIER and JAMES C. NELSON, Justices.
Chief Justice KARLA M. GRAY, dissenting.
¶ 21 I respectfully dissent from the Court's opinion. The District Court did not convert the Rule 12(b)(6) motion to dismiss for failure to state a claim upon which relief could be granted to a motion for summary judgment without notice. Indeed, it properly entered its order granting the defendants' motion to dismiss based on the res judicata bar to the availability of relief in this case.
¶ 22 I agree entirely with the standard of review stated by the Court and with the long-established principle that, in considering a Rule 12(b)(6) motion, all well-pleaded allegations of fact in the complaint must be taken as true. I also agree that such a motion cannot properly be granted unless it appears the plaintiff can prove no set of facts which would entitle him to relief. Contrary to the Court's opinion, however, our case law is clear that res judicatawhich necessarily includes review of matters outside the complaintcan serve as a legal bar to well-pleaded allegations taken as true. We have *321 so held in at least two cases, only one of which the Court addresses and erroneously distinguishes.
¶ 23 Glickman is a 1998 decision which is addressed in the Court's opinion. There, we defined the doctrine of res judicata as "prevent[ing] a party from re-litigating a matter that the party has already had an opportunity to litigate. It is based on the public policy that there must be some end to litigation." When the four res judicata criteria are metan issue not before us in the present casea claim is res judicata. We ultimately held that res judicata barred Glickman's claim and affirmed the district court's grant of the defendants' Rule 12(b)(6) motion on that basis. See Glickman, ¶ 21. In other words, because Glickman had had an earlier opportunity to litigate his claim, his claim was barred as a matter of law because no relief could be granted.
¶ 24 The Court attempts to distinguish the present case from Glickman on the basis that, in that case, the plaintiff's complaint was a collateral attack on a prior judgment, while in this case Plouffe makes factual allegations of tortious conduct by the defendants. This is a distinction without a difference. The critical point is that Plouffe's allegations of tortious conduct were previously litigated, with an outcome adverse to him. Thus, this case also is a collateral attack on an earlier judgment in which Plouffe had madeas the District Court stated"verbatim" allegations against the defendants. Consequently, pursuant to Glickman, res judicata is a proper basis for a motion to dismiss for lack of available relief and, as in Glickman, the District Court in the present case properly premised its grant of the Rule 12(b)(6) motion to dismiss on res judicata.
¶ 25 Prior to Glickman and cited therein, we decided Loney v. Milodragovich, Dale & Dye, P.C. (1995), 273 Mont. 506, 905 P.2d 158. The issue before this Court was whether the trial court erred in dismissing Loney's complaint pursuant to Rule 12(b)(6) on the basis that the claim was barred by the doctrine of res judicata. Loney, 273 Mont. at 509, 905 P.2d at 160. We ultimately held that, Loney having had an opportunity to litigate his claim in an earlier proceeding, res judicata barred his raising the claim and the district court did not err in granting the motion to dismiss on res judicata grounds. Loney, 273 Mont. at 510-11, 905 P.2d at 161. In Plouffe's case, the propriety of applying res judicata is even more clear, since the matters at issue actually were previously litigated. Again, res judicata can properly bar a claim even when well-pled allegations are taken as true.
¶ 26 For these reasons, it is my view that the District Court did not improperly convert the motion to dismiss to a motion for summary judgment. Indeed, no such conversion was necessary to apply the res judicata legal bar. I would conclude the District Court properly applied res judicata in the present case because, taking Plouffe's allegations as true, no relief is available for his claims. Consequently, I would affirm the District Court's grant of the Rule 12(b)(6) motion to dismiss and I dissent from the Court's failure to do so.
Justice JIM RICE joins in the foregoing dissenting opinion.
