
819 So.2d 596 (2001)
Gary SINGLETON
v.
ALABAMA DEPARTMENT OF CORRECTIONS and Warden A.L. Garrett.
1001524.
Supreme Court of Alabama.
October 26, 2001.
*597 Gary Singleton, pro se.
Bill Pryor, atty. gen., and Milt E. Belcher, asst. atty. gen., for appellees.
HARWOOD, Justice.
Gary Singleton, acting pro se, appeals the trial court's grant of a motion to dismiss filed by A.L. Garrett, the warden of the St. Clair Correctional Facility, and the Alabama Department of Corrections (hereinafter jointly referred to as "the defendants"). We reverse and remand.
On January 16, 2001, Singleton, an inmate at the St. Clair Correctional Facility, filed a motion seeking emergency medical treatment. His motion requested that the trial court enter an order directing the defendants to provide him medical treatment for his "keyhole hernia" or to transport him to a specialist for treatment. Singleton stated that he had suffered from the hernia for six to eight months before he filed a "medical complaint/grievance" seeking treatment. Singleton further stated that after he filed the "medical complaint/grievance," he was examined by a Dr. Tingley, who recommended that a Dr. Hammack remove the hernia. At the time he filed his motion, Singleton claimed that over 90 days had passed since Dr. Tingley had made his recommendation, and that his hernia had "moved" and that his condition had worsened, causing him severe pain when he attempted to get out of bed and during urination.
On March 12, 2001, the defendants filed an answer and a motion to dismiss, with an attached affidavit from Warden Garrett. They argued that Singleton's motion failed to state a claim upon which relief could be granted because, they said, they had no responsibility in Singleton's medical care; they further argued that they had not *598 violated Singleton's constitutional rights because, they said, they had no, or very limited, involvement in his treatment. The defendants further stated that Singleton's allegations as to them were misdirected because all treatment for inmates at the St. Clair Correctional Facility was contracted out to a private company, Correctional Medical Services, by the Alabama Department of Corrections. They contended that Garrett, as warden, could not diagnose, order treatment, or otherwise participate in medical decisions involving inmates. The defendants also asserted the defenses of sovereign immunity and qualified immunity, with supporting arguments.
The affidavit of Warden Garrett, attached to the defendants' answer and motion to dismiss, stated, in pertinent part:
"My name is A.L. Garrett and I am presently employed as Warden II with the Alabama Department of Corrections, St. Clair Correctional Facility, Springville, Alabama. I am over the age of twenty-one.
"In response to CV-01-8, I[,] Archie L. Garrett[,] has [sic] no direct knowledge of the Plaintiff's Gary Singletons' [sic] medical condition. I am not a Medical Doctor, and I am not qualified to make diagnoses. I am the Assistant Warden of St. Clair Correctional Facility. To my knowledge, the Plaintiff made no request that I get involved in having Hernia surgery.
"I deny all allegations made by the Plaintiff."
On March 22, 2001, the trial court entered an order on the case action summary that stated:
"Upon consideration of [the] motion to dismiss and upon grounds stated therein, this cause is hereby dismissed. Costs taxed to petitioner."
Although the trial court granted what was titled a motion to dismiss, an affidavit signed by Warden Garrett was attached to the motion. Rule 12(b), Ala. R. Civ. P., states, in pertinent 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 a motion by Rule 56."
(Emphasis added.) See also Hornsby v. Sessions, 703 So.2d 932 (Ala.1997). Therefore, the trial court, by not excluding Warden Garrett's affidavit, was required by Rule 12(b) to treat the defendants' motion to dismiss as a motion for a summary judgment, governed by the provisions of Rule 56, Ala. R. Civ. P.[1] Rule 56(c) states, in pertinent part:
"(c) Motion and Proceedings Thereon.

*599 "(1) Form of Motion and Statement in Opposition Thereto. The motion shall be supported by a narrative summary of what the movant contends to be the undisputed material facts; that narrative summary may be set forth in the motion or may be attached as an exhibit. The narrative summary shall be supported by specific references to pleadings, portions of discovery materials, or affidavits, and may include citations to legal authority. Any supporting documents that are not on file shall be attached as exhibits. If the opposing party contends that material facts are in dispute, that party shall file and serve a statement in opposition supported in the same manner as is provided herein for a summary of undisputed material facts.

"(2) Time. The motion for summary judgment, with all supporting materials, including any briefs, shall be served at least ten (10) days before the time fixed for the hearing, except that a court may conduct a hearing on less than ten (10) days' notice with the consent of the parties concerned. Subject to subparagraph (f) of this rule, any statement or affidavit in opposition shall be served at least two (2) days prior to the hearing."
(Emphasis added.)
In Hales v. First National Bank of Mobile, 380 So.2d 797, 799-800 (Ala. 1980), this Court considered the conversion of a Rule 12(b)(6) motion to dismiss to a Rule 56 motion for a summary judgment. In reversing the trial court's grant of the converted motion for a summary judgment, this Court stated:
"[I]f a motion under Rule 12(b)(6) is converted into a motion for summary judgment, both parties shall be given a reasonable opportunity to submit affidavits and other extraneous proofs to avoid a party being taken by surprise through conversion of the motion to dismiss to one for summary judgment. Davis v. Howard, 561 F.2d 565 (5th Cir.1977); Moore's Federal Practice, Vol. 2A, ¶ 12.09(3), N. 25. It is also clear that the spirit of Rule 56 requires the same notice and hearing where the court contemplates summary judgment on its own initiative as it does when a party moves for summary judgment; i.e., ten days notice. See Davis v. Howard, supra; Georgia Southern & F. Ry. Co. v. Atlantic Coast Line R. Co., 373 F.2d 493 (5th Cir.1967); Bowdidge v. Lehman, 252 F.2d 366 (6th Cir.1958). The entry of summary judgment by a trial court, sua sponte, without giving to the party against whom such judgment is entered adequate and reasonable notice, as well as an opportunity to present evidence in opposition, is prejudicial error requiring reversal. Id.

"We agree with the following statement made by the United States Court of Appeals for the Fifth Circuit in its per curiam opinion in Davis v. Howard, supra:
"`We do not hold that a notice to convert a 12(b)(6) motion into a summary judgment must be by written order, but the record must adequately demonstrate that all counsel were aware of the intentions of the district judge to treat the motion as converted, together with a reasonable opportunity afforded to the nonmoving party to present, by way of affidavit or otherwise, anything necessary to rebut the contention of the moving party. *600 This does not appear in the instant case, although the district judge may have verbally advised counsel to this effect, all of which is not revealed in the record.
"`Today we hold that where matters outside the pleadings are considered in disposition of a Rule 12(b)(6) motion, so as to automatically convert it to one for summary judgment pursuant to Rule 56, or as one made sua sponte, the Rule 56 strictures of notice, hearing and admissibility into evidence are strictly required. As Judge Goldberg aptly observed of the notice requirement in Soley v. Star & Herald Co., 390 F.2d 364, 369-70 (5[th] Cir.1968): "They [the litigants] cannot read over the judge's shoulder, or penetrate his memory. Nor can we. From Shakespeare's Hamlet to Albee's Tiny Alice, soliloquies and asides have been shared with the audience." Where there is a motion to dismiss for failure to state a claim upon which relief may be granted, there can never be a wide overview by the trial court, beyond the pleadings to include matters outside, without affording all litigants the opportunity to offer their perspectives on the additional matter by way of admissible evidence.
"`The bridling devices at issue here sustain and insure the most elementary operation of our civil law. The concepts of notice, admissibility, and opportunity to be heard are ancient primaries. Independent from these notions in advocacy, there is the trial court's duty to insure that its basis for judgment is without error. This duty of the trial court distinguishes the margin of allowances we have held in the instance of an original Rule 56 motion from summary disposition following a Rule 12(b)(6) motion.... However correct the conclusion below may be in the end, we cannot allow the shaving of principles for expediency when these precepts assure order and justice.' 561 F.2d at 571, 572."
See also Graveman v. Wind Drift Owners' Ass'n, Inc., 607 So.2d 199 (Ala.1992). While Hales was decided before the August 1, 1992, amendments to Rule 56(c) and Rule 56(f), those amendments do not affect the rationale expressed in that case. See Ex parte Richardson, 752 So.2d 1112 (Ala.1999).
Based upon this Court's holding in Hales and the cases cited therein, we must reverse the trial court's grant of the motion to dismiss filed by the defendants. The trial court's acceptance of Warden Garrett's affidavit required that the motion to dismiss be treated as a motion for a summary judgment. Rule 12(b), Ala. R. Civ. P., and Hornsby v. Sessions, supra. Singleton was entitled to notice that the motion had been converted to a motion for a summary judgment, to the opportunity to be heard, and to such other procedural relief as contemplated by Rule 56, Ala. R. Civ. P. In addition, an entry of a summary judgment for the defendants would not be proper until they have complied with the requirement of the rule that they submit a narrative summary of what they contend to be the undisputed material facts. See Rule 56(c), Ala. R. Civ. P., Northwest Florida Truss, Inc. v. Baldwin County Comm'n, 782 So.2d 274 (Ala.2000), and Moore v. ClaimSouth, Inc., 628 So.2d 500 (Ala.1993). This cause is therefore remanded for the trial court to proceed in a manner consistent with this opinion.
REVERSED AND REMANDED.
MOORE, C.J., and SEE, BROWN, and STUART, JJ., concur.
NOTES
[1]  Although we presume that the trial court considered the motion to dismiss and the attached affidavit because it did not state that it excluded the affidavit, we note that a dismissal by the trial court would also not be appropriate. At this point in the proceedings, the defendants' motion, even viewed as a motion to dismissi.e., excluding Warden Garrett's affidavitdoes not establish that Singleton could not prove any set of circumstances that would entitle him to relief. See Nance v. Matthews, 622 So.2d 297 (Ala.1993).

In Estelle v. Gamble, 429 U.S. 97, 104, 97 S.Ct. 285, 50 L.Ed.2d 251 (1976), the United States Supreme Court held that "deliberate indifference to serious medical needs of prisoners constitutes the `unnecessary and wanton infliction of pain,' Gregg v. Georgia, [428 U.S. 153], at 173, 96 S.Ct. [2909,] at 2925 [(1976)] (joint opinion), proscribed by the Eighth Amendment." Moreover, the fact that the defendants contract out the medical services provided to prisoners does not relieve them of their duty to see to it that those medical services are adequate. See West v. Atkins, 487 U.S. 42, 56, 108 S.Ct. 2250, 101 L.Ed.2d 40 (1988)("Contracting out prison medical care does not relieve the State of its constitutional duty to provide adequate medical treatment to those in its custody, and it does not deprive the State's prisoners of the means to vindicate their Eighth Amendment rights.").
