
251 N.W.2d 551 (1977)
Joan M. LLOYD, Appellant,
v.
STATE of Iowa, Appellee.
Donald A. POTTER, Appellant,
v.
STATE of Iowa, Appellee.
No. 2-57389.
Supreme Court of Iowa.
March 16, 1977.
*552 John K. von Lackum and David A. Elderkin, of Wadsworth, Elderkin, Pirnie & von Lackum, Cedar Rapids, for appellants.
Richard C. Turner, Atty. Gen., John E. Beamer, Special Asst. Atty. Gen., Joseph S. Kelly, Jr., and Fred M. Haskins, Asst. Attys. Gen., for appellee.
Heard before MOORE, C. J., and MASON, UHLENHOPP, HARRIS and McCORMICK, JJ.
*553 MASON, Justice.
This is a consolidation of appeals by plaintiffs in two tort claim cases from the trial court's ruling granting the State summary judgment.
August 21, 1973, plaintiffs, Joan M. Lloyd and Donald A. Potter, filed petitions seeking relief under the Iowa Tort Claims Act, chapter 25A, The Code, 1973, based upon the alleged negligence of the State by and through the actions of the director of the Bureau of Adult Corrections, Department of Social Services. Plaintiffs' claims for relief were subsequently consolidated for trial. May 21, 1974, the trial court granted the State a summary judgment on both claims and that action is the subject of plaintiffs' appeal herein.
In October of 1968 Jack Leonard Lemburg was sentenced to the Iowa State Penitentiary at Fort Madison for a term not to exceed one year. While in residence at said institution Lemburg was transferred to the Iowa Security Medical Facility at Oakdale for evaluation pursuant to section 246.17, The Code, which provides:
"When the state director has reason to believe that a prisoner in the penitentiary or said reformatory, whose sentence has expired, is mentally ill, it shall cause examination to be made of such prisoner by competent physicians who shall certify to the state director whether such prisoner is in good mental health or mentally ill. The state director may make further investigation and if satisfied that he is mentally ill, he may cause him to be transferred to one of the hospitals for the mentally ill, or may order him to be confined in the Iowa security medical facility."
Dr. Douglas N. Johnson, a psychiatrist and clinical director at the Oakdale facility during Lemburg's evaluational visit there, certified the conclusions of the staff to Nolan Ellandson, Director of the Bureau of Adult Corrections, on March 28, 1969, providing in pertinent part as follows:
"On examination, the patient shows no signs of psychosis, neurosis or brain damage. * * *
"* * *
"Staff diagnosis is anti-social personality of severe degree. * * * Emotional instability should also be noted.
"An anti-social personality does not, in the opinion of staff psychiatrists (and we think of most other psychiatrists in the State of Iowa) constitute a mental illness. At the same time, Mr. Lemburg, with his severely disordered personality, certainly is not mentally healthy. We detected nothing in our evaluation that allows us reasonably to predict a change in his behavior so that if he is released he would, in our opinion, continue with the extremely dangerous behavior which has characterized his past. Whether these opinions are sufficient to allow commitment under Section 246.17 of the 1966 Iowa Code, we do not know. We must, therefore, leave that to your judgment. Society certainly deserves protection from the acts of Mr. Lemburg."
Evidently, Dr. Johnson's report did not lead Director Ellandson to believe Lemburg was mentally ill because on April 27, 1969, Lemburg was transferred to the custody of federal authorities pursuant to a federal detainer and was imprisoned at Leavenworth, Kansas, until March 1970.
February 21, 1971, Lemburg allegedly severely beat and sexually assaulted plaintiff Lloyd outside her Cedar Rapids home. Lemburg was apprehended shortly thereafter and during a recess of his preliminary hearing allegedly attacked plaintiff Potter, an employee of the Cedar Rapids Police Department. There is no evidence of record pertaining to the charges, if any, filed against Lemburg as a result of these incidents or the dispositions thereof.
Pursuant to section 25A.5, The Code, following the filing of written claims with the state appeal board and the failure of that board to make final dispositions of plaintiffs' claims, plaintiffs commenced this action in the Linn District Court. Plaintiffs Lloyd and Potter seek $500,000 and $150,000 in damages, respectively, asserting as a basis for recovery the negligence of the State through the actions of its employee *554 Ellandson in releasing Lemburg from custody.
Shortly after plaintiffs' petitions were filed the State filed a motion to dismiss for failure to state a claim upon which relief might be granted. The trial court overruled the first division of said motion in a ruling dated October 5, 1973, and noted therein the State had withdrawn the second division thereof. In the latter division the State had argued Ellandson's decision not to commit Lemburg "was clearly a discretionary one" as evidenced by the provisions of section 246.17 and thus could not support an action under chapter 25A because clearly excepted therefrom by section 25A.14(1) which as then in force provided:
"The provisions of this chapter shall not apply to:
"1. Any claim based upon an act or omission of an employee of the state, exercising due care, in the execution of a statute or regulation, whether or not such statute or regulation be valid, or based upon the exercise or performance or the failure to exercise or perform a discretionary function or duty on the part of a state agency or an employee of the state, whether or not the discretion be abused."
The State answered plaintiffs' petitions by denying most of the operative allegations contained therein. Division 2 of the State's answer set out a proximate cause defense based upon the "intervening federal prison term" served by Lemburg which allegedly "broke the chain of causation." The discretionary function exception established by section 25A.14(1) was not set out with reference to that statutory provision as a defense to plaintiffs' claims for relief.
Following the aforementioned consolidation order the State filed the motion for summary judgment which gives rise to the ruling which is challenged by plaintiffs' appeal. Said motion was in two divisions but only the first is material hereto. The essence of that division was that even if a prisoner is determined to be mentally ill within the meaning of section 246.17 that section does not require the director to commit said prisoner but leaves that decision to the discretion of the director.
Plaintiffs resisted the motion for summary judgment alleging the existence of numerous genuine fact issues which therefore made summary judgment unavailable to the State.
May 21, 1974, the trial court ruled on the State's motion for summary judgment, concluding in part as follows:
"There is no genuine issue of fact present but that the Defendant's employees did the acts, or omitted to do acts complained of in the specifications of negligence, but such acts are discretionary (may make further investigation, may cause * * * or may order) on the part of the employee under Section 246.17 and are an exception to the provisions of Chapter 25A and after a trial it would be the duty of the Court to direct a verdict for the Defendant."
Plaintiffs maintain the trial court erred in sustaining the State's motion for summary judgment and in support thereof assert the following contentions:
1. The discretionary function exception of section 25A.14(1) was not properly raised in the instant case as there was no reference to it in the State's motion for summary judgment.
2. The discretionary function exception of section 25A.14(1) was not properly before the trial court as the same was an affirmative defense which was not pled in the State's answer.
3. The State waived its right to assert the discretionary function exception of section 25A.14(1) and is now estopped from asserting it.
4. The trial court went far beyond the apparent issue raised in the State's motion for summary judgment, which issue, assuming arguendo a sufficient undisputed factual basis, should have been decided in favor of plaintiffs.
5. The trial court improperly treated the State's motion for summary judgment as a motion to dismiss and considered the facts set forth in plaintiffs' petitions as undisputed for purposes of the motion, notwithstanding *555 that said facts were denied in the State's answer.
6. Summary judgment should not have been granted because under no conceivable circumstances could the record in question have been construed to show a right to judgment with such clarity as to leave no room for controversy or establish affirmatively that plaintiffs could not prevail.
I. Prior to enactment of chapter 25A, The Code, known as the "Iowa Tort Claims Act," which became effective March 30, 1965, our courts lacked jurisdiction over suits brought against the state or its agencies sounding in tort. This court had held in Montandon v. Hargrave Construction Co., 256 Iowa 1297, 130 N.W.2d 659, the doctrine of governmental immunity to tort actions was jurisdictional.
The holding in Montandon was modified by enactment of chapter 25A to the extent sovereign immunity for suits in tort brought against the State or its agencies was waived under the provisions of the Tort Claims Act.
Section 25A.14 makes clear the legislature did not intend the Iowa Tort Claims Act to be a waiver of sovereign immunity in all instances. It was designed primarily to remove sovereign immunity for suits in tort with certain specified exceptions set out in the statute.
Under the Act the State or its agencies is subject to suit in tort as an individual only in the manner and to the extent to which consent has been given by the legislature. The immunity of the State is from suit rather than from liability and remains the rule rather than the exception. See in support of the foregoing statements Hubbard v. State, 163 N.W.2d 904 (Iowa 1969).
In Saxton v. State, 206 N.W.2d 85, 86 (Iowa 1973), this court held enactment of chapter 25A did not affect the holding in Montandon that our courts lacked subject matter jurisdiction where plaintiff's action came within one of the exceptions to state tort liability enumerated in section 25A.14.
II. Plaintiffs claim the State's failure to mention the discretionary function exception of section 25A.14(1) by name or with reference to that section in the motion for summary judgment resulted in its not being properly raised before the trial court. Although not articulated it appears to be plaintiffs' position such failure prohibited the trial court from granting summary judgment on the basis of that particular section.
The first division of the State's motion for summary judgment placed a great deal of importance on the director's alleged discretion in committing prisoners under section 246.17. The voluntarily withdrawn division of the State's motion to dismiss specifically referred to, and indeed set out, the provisions of section 25A.14(1). The State's brief in support of the motion for summary judgment quoted extensively from federal cases dealing with the discretionary function exception. Most importantly, plaintiffs' actions were brought under the provisions of chapter 25A which, as pointed out, includes a number of specific exceptions to the provisions thereof, including the discretionary function exception.
In light of the foregoing facts the exception announced in section 25A.14(1) was arguably sufficiently called to the trial court's attention to warrant its application of that section in determining the validity of defendant's attack on plaintiffs' claims.
III. Plaintiffs contend the discretionary function exception of section 25A.14(1) is an affirmative defense which must be raised in a responsive pleading. Rules 103 and 104, Rules of Civil Procedure. Since the State's answer made no mention of the discretionary function exception as a defense to plaintiffs' claims for relief plaintiffs contend that defense was no longer available to the State and could not be the basis of the trial court's grant of summary judgment.
The State, on the other hand, maintains the discretionary function exception is a jurisdictional defense which may be raised at any time. See Bowen v. Story County Board of Supervisors, 209 N.W.2d 569, 572 (Iowa 1973); Green v. Sherman, 173 N.W.2d *556 843, 846 (Iowa 1970); Steffens v. Proehl, 171 N.W.2d 297, 300 (Iowa 1969).
Saxton v. State, 206 N.W.2d at 86, involved an appeal from a ruling sustaining the State's special appearance in an action brought under chapter 25A, The Code. In affirming the trial court this court said:
"The narrow question presented is whether plaintiffs' action comes within one of the exceptions to state tort liability enumerated in Code § 25A.14. If it does, the court lacked subject matter jurisdiction * * *. See Hubbard v. State, 163 N.W.2d 904, 907 (Iowa 1969)."
With no mention of Saxton plaintiffs direct this court's attention to several federal court decisions holding that the enumerated exceptions to the Federal Tort Claims Act are not jurisdictional. Federal court interpretations of common statutory language between the federal act and chapter 25A were approved as guideposts in seeking the legislative intent in enacting chapter 25A in Hubbard v. State, 163 N.W.2d at 910-911.
It cannot be denied several federal court decisions are supportive of plaintiffs' position. See Stewart v. United States, 199 F.2d 517, 519-520 (7 Cir. 1952); Neher v. United States, 265 F.Supp. 210, 215 (D.Minn.1967); Smith v. United States, 155 F.Supp. 605, 612 (E.D.Va.1957). However, the majority position appears to be that the statutorily enumerated exceptions to the Federal Tort Claims Act are indeed jurisdictional defenses. See Gibson v. United States, 457 F.2d 1391, 1392 (3 Cir. 1972); United States v. Taylor, 236 F.2d 649, 652 (6 Cir. 1956), 74 A.L.R.2d 860; Konecny v. United States, 388 F.2d 59, 62-63 (8 Cir. 1967); United States v. DeCamp, 478 F.2d 1188, 1191 (9 Cir. 1973), cert. den., 414 U.S. 924, 94 S.Ct. 232, 38 L.Ed.2d 158 (1973); Morris v. United States, 521 F.2d 872, 874 (9 Cir. 1975); Nichols v. United States, 236 F.Supp. 241, 242 (S.D.Cal.N.D.1964); Paley v. Wolk, 262 F.Supp. 640, 643 (N.D.Ill.E.D.1965), cert. den., 386 U.S. 963, 87 S.Ct. 1031, 18 L.Ed.2d 112 (1967). Cf. Dalehite v. United States, 346 U.S. 15, 31, 73 S.Ct. 956, 965, 97 L.Ed. 1427 (1953).
The authorities relied upon by plaintiffs were all decided prior to this court's decision in Saxton, supra. Although authority to the contrary exists, this court's statement that the statutory exceptions to chapter 25A constitute jurisdictional prohibitions is supported by the apparent majority of courts which have confronted that issue and we see no reason for retracting that statement.
The law in Iowa appears to be well settled that want of jurisdiction of the subject matter may be taken advantage of at any stage of the proceedings. It cannot be conferred by waiver, estoppel or consent. It can be raised at any time and need not be pled. Dickey v. City of Burlington, 247 Iowa 116, 118, 73 N.W.2d 96, 98; Steffens v. Proehl, 171 N.W.2d at 300; Green v. Sherman, 173 N.W.2d at 846; Bowen v. Story County Board of Supervisors, 209 N.W.2d at 572.
Even if the State had made no attack on the court's jurisdiction of the subject matter, the trial court had an inherent affirmative duty to determine whether it had jurisdiction over the subject matter of the claims before it.
"Every court has inherent power to determine whether it has jurisdiction over the subject matter of the proceedings before it. It makes no difference how the question comes to its attention. Once raised, the question must be disposed of, no matter in what manner of form or stage presented. The court on its own motion will examine grounds of its jurisdiction before proceeding further." Carmichael v. Iowa State Highway Commission, 156 N.W.2d 332, 340 (Iowa 1968). See also Lynch v. Uhlenhopp, 248 Iowa 68, 80, 78 N.W.2d 491, 498.
This brings us to the question whether lack of subject matter jurisdiction may be raised by defendant for the first time in a motion for summary judgment filed after answer. We adhere to the pronouncements made in the decisions just cited and conclude the question of lack of subject matter jurisdiction can be raised in *557 any manner and at any stage of the proceedings and that it was properly raised in this instance in defendant's motion for summary judgment.
Because lack of subject matter jurisdiction need not be pled, Steffens v. Proehl, 171 N.W.2d at 300, plaintiffs' contention the want of such jurisdiction must be raised in a responsive pleading is without merit.
This is not to say a contention of lack of subject matter jurisdiction asserted in a motion for summary judgment affords a proper basis for an award of summary judgment. We will return to this later.
IV. Plaintiffs' argument that the State waived its right to assert or should be estopped from asserting the discretionary function exception of section 25A.14(1) is without merit. The doctrines of waiver and estoppel have no application when the issue is whether the trial court possessed jurisdiction over the subject matter of the proceedings before it. State ex rel. Iowa St. Hwy. Com'n. v. Read, 228 N.W.2d 199, 202 (Iowa 1975); Green v. Sherman, supra, 173 N.W.2d at 846; Steffens v. Proehl, supra, 171 N.W.2d at 300; Nelson v. Iowa-Illinois Gas & Elec. Co., 259 Iowa 101, 111-112, 143 N.W.2d 289, 296.
V. The basis of plaintiffs' fourth contention is that section 246.17 does not give the director discretion to decide whether a prisoner should be committed but only permits discretion in deciding where a prisoner should be committed. At this point plaintiffs are not attacking the propriety of summary judgment relief under the record before the trial court but are merely challenging the legal conclusion reached by the trial court in granting that relief.
Section 246.17 clearly leaves to the director's discretion the decision whether to commit a prisoner and where to have him committed. A prisoner is to be transferred to a state hospital for the mentally ill or to the Oakdale facility if the director is "satisfied that he is mentally ill * * *." A requirement that one be personally satisfied a condition in fact exists before action is taken clearly involves discretion on the part of the decision-maker. This is the type of discretionary decision prohibited by section 25A.14(1) from serving as the basis for a tort claim against the State. If Lemburg had been committed and had subsequently escaped due to the negligence of state employees the State would not be shielded from liability by section 25A.14(1). See Seiber v. State, 211 N.W.2d 698, 700 (Iowa 1973). However, plaintiffs' claims for relief focus on the decision itself and not the negligent implementation of that discretionary decision.
VI. Plaintiffs argue the trial court erred in granting summary judgment for the State when in fact genuine factual issues existed and, in addition, applied incorrect principles in assessing the appropriateness of such relief.
As previously determined and as the trial court held, plaintiffs' claims come within the parameters of section 25A.14(1), The Code. Consequently, neither this court nor the trial court has jurisdiction over the subject matter of plaintiffs' claims.
"Jurisdiction of the subject matter is the power to hear and determine cases of the general class to which the proceeding belongs. * * * [citing authority]. It is an abstract question unrelated to the rights of the parties on the merits of a given case. * * * [citing authority]." State ex rel. Iowa St. Hwy. Com'n. v. Read, 228 N.W.2d at 202.
"A motion for summary judgment has two uses in connection with a defense to plaintiffs' action. First, the motion may be made by plaintiff to test the defense's sufficiency. Second, defendant may employ a summary judgment motion to assert a defense that entitles him to judgment as a matter of law." 10 Wright and Miller, Federal Practice and Procedure: Civil, section 2734.
The movant under a summary judgment motion is asserting that on the basis of the record as it then exists, there is no genuine issue as to any material fact and that he is entitled to a judgment on the merits as a matter of law. Id., section 2713; rule 237(c), R.C.P.
*558 While a motion for summary judgment is an appropriate method for raising the issue of subject matter jurisdiction entry of a summary judgment is not an appropriate method of disposing of that issue. Once a court has determined subject matter jurisdiction of a claim is lacking it has no power to enter a judgment on the merits of said claim.
If the court has no subject matter jurisdiction it has no power to enter a judgment on the merits and must dismiss the action.
Faced with a similar procedural situation, the court in Thompson v. United States, 291 F.2d 67, 68 (10 Cir. 1961), said:
"The issues to be decided in this appeal are whether the district court had jurisdiction to adjudicate appellant's counterclaim and whether that question was properly raised by appellee's motion for summary judgment.
"A motion for summary judgment lies whenever there is no genuine issue as to any material fact. It is not a substitute for a motion to dismiss for want of jurisdiction. If the court lacks jurisdiction it cannot render a judgment but must enter an order dismissing the action. We need not dwell on the improper manner in which the jurisdictional issue was invoked. It is elementary that the court's first duty is to determine its jurisdiction to entertain and decide a case on its merits. It must make this determination regardless of the impropriety of appellee's motion." See also Heyward v. Public Housing Administration, 238 F.2d 689, 694 (5 Cir. 1956); Riley v. Titus, 89 U.S.App.D.C. 79, 190 F.2d 653, 655, n. 1, cert. den., 342 U.S. 855, 72 S.Ct. 82, 96 L.Ed. 644; Jones v. Brush, 143 F.2d 733, 734 (9 Cir. 1944); Northern Assurance Co. v. Associated Independent Dealers, 313 F.Supp. 816, 819 (D.Minn.1970); Miller v. National Maritime Union, 275 F.Supp. 809, 810 (E.D.Pa.1967).
Once the objection to subject matter jurisdiction has been brought to the attention of the court, no matter in what manner of form presented, the question must be disposed of. In this connection a court should treat an improperly identified motion that actually challenges the court's authority or competence to hear the matter as if it properly raised the jurisdictional point. 5 Wright and Miller, Federal Practice and Procedure: Civil, section 1350; 6 Pt. 2 Moore's Federal Practice, paragraph 65. "Accordingly, the label attached to the motion should not prevent the court from deciding a summary judgment motion challenging the court's subject matter jurisdiction as a suggestion that the court dismiss the action on that ground." Id. section 2713, p. 406.
If the court determines subject matter jurisdiction is absent an order dismissing the claim is the only appropriate disposition.
The trial court's legal conclusions herein were correct. The only error committed was the entry of judgment for defendant when the appropriate disposition was entry of an order dismissing plaintiffs' claims. This matter must therefore be remanded for the limited purpose of setting aside the award of summary judgment and entering an order dismissing plaintiffs' claims.
VII. Plaintiffs' final contention is without merit in light of the determination reached in the previous division.
The case is therefore Affirmed in part, reversed in part and remanded with directions.
