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, Department of Environmental Quality and John Does I through XX. Plouffe alleged *415that 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 *416that 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 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 *417the 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, 893 P.2d at 393 (quoting Gebhardt, 203 Mont. at 389, 893 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 *41812(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 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 plaintiffs 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 sheriffs sales” of the subject property. Glickman, ¶ 8. 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 *419response 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.
JUSTICES LEAPHART, COTTER, REGNIER and NELSON concur.