
160 P.3d 552 (2007)
2007 MT 129
Mykl MEAGHER, Plaintiff and Appellant,
v.
BUTTE-SILVER BOW CITY-COUNTY, A Municipal Corporation and Political Subdivision of the State of Montana, Defendant and Respondent.
No. DA 06-0136.
Supreme Court of Montana.
Submitted on Briefs December 28, 2006.
Decided June 5, 2007.
*554 For Appellant: Kevin E. Vainio, Butte, Montana.
For Respondent: Eileen Joyce, Butte-Silver Bow Deputy County Attorney, Butte, Montana.
Justice PATRICIA O. COTTER delivered the Opinion of the Court.
¶ 1 Mykl Meagher appeals the Second Judicial District Court's grant of summary judgment in favor of Butte-Silver Bow City-County (BSB or the County). Meagher filed a Complaint against BSB alleging that the County breached an oral agreement under which the County agreed to sell certain properties to Meagher. BSB filed a motion to dismiss pursuant to M.R. Civ. P. 12(b)(6) (Rule 12(b)(6)). The District Court converted the Rule 12(b)(6) motion into a motion for summary judgment and entered judgment in favor of the County. Meagher appeals. We reverse and remand.

ISSUES
¶ 2 A restatement of the issues on appeal is:
¶ 3 Did the District Court erroneously fail to comply with M.R. Civ. P. 56 (Rule 56) when it converted the County's Motion to Dismiss to a motion for summary judgment?
¶ 4 Did the District Court err when it denied Meagher's motion for a continuance?

FACTUAL AND PROCEDURAL BACKGROUND
¶ 5 In October 2003 Butte-Silver Bow City-County acquired several properties through tax forfeiture proceedings and posted them for sale at the County Treasurer's Office. In July 2004 Meagher identified five properties he wished to purchase from the County. As required by the county treasurer, Meagher submitted five letters to the Chief Executive and Council of Commissioners, offering in each to pay BSB's established bid value for the respective parcels. Attached to each letter was a $50.00 check to cover the required administrative fee.
¶ 6 In August 2004 the County met with Meagher and orally agreed to sell him the two properties located on W. Broadway Street and S. Wyoming Street, contingent upon Meagher completing specified restoration and remodeling work on the properties by November 1, 2004. It also agreed to place a hold on selling two of the other *555 properties Meagher wanted to purchase conditioned on his restoration work on the Broadway and Wyoming Street properties. The BSB Council memorialized the oral agreement as it pertained to the sale of the Broadway and Wyoming Street properties in a September 15, 2004, resolution. Meagher undertook the required work, expended approximately $30,000.00 in labor and material, and held an open house showing the remodeled properties on November 15, 2004. Several commissioners attended the open house. BSB subsequently conveyed these two properties to Meagher.
¶ 7 Despite repeated requests by Meagher between September 2004 and June 2005, the County ultimately denied his requests to purchase the other three properties and recommended that the administration fees he had paid for each of these properties be returned to him.
¶ 8 On July 25, 2005, Meagher filed suit against BSB claiming that he and BSB had entered into an oral contract under which the County was obligated to sell him all five properties on which he had placed bids and paid administrative fees. He sought specific performance under this oral agreement. In August 2005 the County filed a Motion to Dismiss under Rule 12(b)(6) on the ground that the Complaint failed to state a claim for which relief could be granted. In its Brief in Support of Motion to Dismiss, the County argued that no oral or written agreement existed, and therefore specific performance was unavailable.
¶ 9 Meagher responded with a brief in opposition to the County's Motion to Dismiss in which he specifically objected to the County's inclusion of "facts, exhibits and arguments" that extended beyond the contents of his Complaint. While objecting to the County's additional "facts," Meagher explained that he included additional facts in his brief in opposition so as "to more clearly answer the [County's] Brief." He noted that if the District Court considered the additional facts presented by the parties, the court would be converting the County's Motion to Dismiss into a motion for summary judgment. Meagher advised the court that if it intended to undertake such a conversion the District Court had to provide the parties with notice of its intent and allow him the opportunity to produce pertinent and relevant facts to overcome summary judgment. The County filed its reply brief in support of its Motion to Dismiss in which it indicated that it "would not object to the [c]ourt converting its Motion to Dismiss to a Motion for Summary Judgment and allowing [Meagher] to supplement the record."
¶ 10 On September 27, the District Court scheduled a hearing on BSB's Motion to Dismiss for November 1, 2005. On October 11, it rescheduled the hearing for October 19, 2005. On October 13, it vacated the hearing until further notice, and on October 20, rescheduled it for November 7, 2005. In each notice, the District Court referred to the hearing as a hearing on the County's Motion to Dismiss. On October 28, 2005, Meagher filed an affidavit in which he detailed his recollection of the dealings with the County vis-à-vis the five properties. On Friday, November 4, Meagher's counsel filed a Motion to Continue Hearing explaining that Meagher had left for Thailand on business, and requesting a continuance of the hearing until the second week of March at which time Meagher would have returned. The District Court did not receive Meagher's Motion until Monday morning, November 7, just prior to the commencement of the hearing. After considering Meagher's request and the County's objection to a continuance, the court denied Meagher's motion and held the scheduled hearing.
¶ 11 The court heard testimony with respect to facts, exhibits and evidence beyond what was included in Meagher's Complaint. On December 28, 2005, it issued its Order Granting Motion for Summary Judgment to BSB. In it the court explained that
[T]he parties' subsequent pleadings proposed that the [c]ourt convert such Motion [to Dismiss] to a Motion for Summary Judgment. Meagher has also supplemented the record through filing an Affidavit in support of his position. The [c]ourt reviewed the briefs submitted, the oral arguments, and the pleadings in their entirety and considered the same.
*556 The District Court ruled that no contract existed between the parties and therefore the County was not obligated to sell the remaining three properties to Meagher. Additionally, it determined that the County had the authority to seek and accept a separate purchase proposal from another buyer under a "developer's packet." Lastly it held that no genuine issues of material fact existed and the County was entitled to judgment as a matter of law.
¶ 12 Meagher appeals. We reverse and remand the matter to the District Court for further proceedings.

STANDARD OF REVIEW
¶ 13 We review de novo a district court's ruling on a motion to dismiss pursuant to Rule 12(b)(6). A motion to dismiss under Rule 12(b)(6) 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. Plouffe v. State, 2003 MT 62, ¶ 8, 314 Mont. 413, ¶ 8, 66 P.3d 316, ¶ 8 (citations omitted).
¶ 14 We also review an order granting summary judgment de novo, relying on the provisions of M.R. Civ. P. Rule 56. Hajenga v. Schwein, 2007 MT 80, ¶ 11, 336 Mont. 507, ¶ 11, 155 P.3d 1241, ¶ 11 (citation omitted). Summary judgment is an extreme remedy that should be granted only when there is no genuine issue as to any material fact and the moving party is entitled to judgment as a matter of law. Hajenga, ¶ 11.

DISCUSSION
¶ 15 The first issue before us is whether the District Court erred in converting the County's Motion to Dismiss into a motion for summary judgment without giving notice to Meagher. A motion to dismiss under Rule 12(b)(6) allows the district court to examine only whether "a claim has been adequately stated in the complaint." Gebhardt v. D.A. Davidson & Co., 203 Mont. 384, 389, 661 P.2d 855, 857 (1983). As a result, the court is limited to an examination of the contents of the complaint in making its determination of adequacy. Additionally, the effect of a Rule 12(b)(6) motion to dismiss is that all the well-pleaded allegations in the complaint are admitted as true; therefore, it should not be dismissed "unless it appears beyond reasonable doubt that the plaintiff can prove no set of facts which would entitle him to relief." Gebhardt, 203 Mont. at 389, 661 P.2d at 857-58 (citation omitted).
¶ 16 Rule 12(b) allows the court to convert a motion to dismiss into a motion for summary judgment when matters outside the pleadings are presented to the court. Rule 12(b) states in part:
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.)
Thus, the court has the discretion to include or exclude matters presented to it that are outside of the pleadings when considering a motion to dismiss. If it chooses to include matters outside of the pleadings, however, it must treat the motion as a motion for summary judgment under Rule 56 and provide notice to the parties of its intention to do so. Gebhardt, 203 Mont. at 390, 661 P.2d at 858. See also Hoveland v. Petaja, 252 Mont. 268, 271, 828 P.2d 392, 393-94 (1992); State ex rel. Dept. of H. & E.S. v. City of Livingston, 169 Mont. 431, 436, 548 P.2d 155, 157 (1976); Graveley v. MacLeod, 175 Mont. 338, 344, 573 P.2d 1166, 1169 (1978). The purpose of notice is to allow the parties a reasonable opportunity to present all material pertinent to the motion and avoid surprise. Plouffe, ¶ 15. This includes an opportunity to produce additional facts by affidavit or otherwise which would establish a genuine issue of material fact to preclude summary judgment under Rule 56. Plouffe, ¶ 15 (citing Hoveland, 252 Mont. at 271, 828 P.2d at 394).
*557 ¶ 17 As observed above, summary judgment is an extreme remedy. Hajenga, ¶ 11. What makes it extreme is that an order of summary judgment is a ruling on the merits which terminates a complainant's district court proceedings with prejudice. On the other hand, dismissal of a complaint for failure to state a claim upon which relief may be granted is not a "terminal" ruling on the merits; thus, a complainant is free to recast his or her complaint and file it anew, as long as this can be done within the period of limitations.
¶ 18 Meagher argues that the District Court erred by converting the County's Motion to Dismiss to a motion for summary judgment without notice to the parties. He asserts that he did not acquiesce to the conversion and that the mere presentation of facts beyond the Complaint by both parties did not relieve the court of its obligation to provide notice of its intent to convert the proceeding. BSB counters that the District Court correctly dismissed Meagher's Complaint because Meagher failed to establish the existence of a valid enforceable contract. It further maintains that because dismissal was correct the court's decision to resolve the matter through summary judgment rather than simple dismissal was harmless error. BSB also argues that the parties acquiesced to the conversion of the motion.
¶ 19 We find no merit in the County's argument that Meagher acquiesced to the conversion of the motion to dismiss to one for summary judgment. In fact, Meagher expressly asked the District Court for the statutory notice in the event the court chose to convert the motion. While Meagher may have filed an affidavit, he did so not knowing whether the affidavit would be considered or that he was in fact facing summary judgment proceedings. We cannot know whether he would have expanded his affidavit or requested a full hearing on the summary judgment matter, as he had the right to do under Rule 56, had he been provided notice of the conversion. Meagher had a right to notice of the conversion as he requested and as our cases require. See Plouffe, ¶ 15, and the cases cited at ¶ 16 of this Opinion. Moreover, given that the court referred in each notice of hearing to a motion to dismiss and not to a summary judgment hearing, we cannot conclude Meagher knew he was facing summary judgment proceedings and acquiesced to the conversion.
¶ 20 As noted above, the distinction between dismissal and summary judgment is more than academic. The former allows for the possibility of re-filing a complaint so as to withstand dismissal, while the latter is a final adjudication on the merits. Therefore, we cannot agree that the conversion was, as argued by BSB, harmless error. Therefore, we reverse the court's order of summary judgment and remand for further proceedings.
¶ 21 Finally, in light of the foregoing, we need not address Meagher's claim that the District Court erred in denying his motion to continue the hearing.

CONCLUSION
¶ 22 For the foregoing reasons, we reverse the District Court's Order granting summary judgment and remand this matter for further proceedings consistent with this Opinion.
We Concur: BRIAN MORRIS, W. WILLIAM LEAPHART, JIM RICE and JOHN WARNER, JJ.
