
689 So.2d 1040 (1996)
FLORIDA MEDICAL MALPRACTICE JOINT UNDERWRITING ASSOCIATION, Petitioner,
v.
INDEMNITY INSURANCE COMPANY OF NORTH AMERICA, Respondent.
ST. PAUL FIRE & MARINE INSURANCE COMPANY, Petitioner,
v.
INDEMNITY INSURANCE COMPANY OF NORTH AMERICA, Respondent.
Nos. 85683, 85715.
Supreme Court of Florida.
December 26, 1996.
Rehearing Denied March 17, 1997.
Bruce Culpepper, Darren A. Schwartz and Barbara D. Auger of Pennington & Haben, P.A., Tallahassee, on behalf of Florida Medical Malpractice Joint Underwriting Association; and Scott H. Michaud and James T. Ferrara of Michaud, Buschmann, Fox, Ferrara *1041 & Mittelmark, P.A., Boca Raton, on behalf of St. Paul Fire & Marine Insurance Company, for Petitioners.
Daniel S. Pearson, Lucinda A. Hofmann, Linda Ann Wells and Lenore C. Smith of Holland & Knight, Miami, for Respondent.
PER CURIAM.
We have for review the opinion in Florida Medical Malpractice Joint Underwriting Ass'n v. Indemnity Insurance Co., 652 So.2d 1148 (Fla. 4th DCA 1995), which certified conflict with the opinion in Sebring Utilities Comm'n v. Sicher, 509 So.2d 968 (Fla. 2d DCA 1987). We have jurisdiction. Art. V, § 3(b)(4), Fla. Const.
Juan Figueredo sued the Miami Children's Hospital (MCH) for severe injuries to his daughter that he claimed resulted from negligent treatment and premature discharge from the hospital's emergency room. MCH was insured by Florida Medical Malpractice Joint Underwriting Association (JUA) for claims up to $500,000 and by Indemnity Insurance Company of North America (IINA) for claims between $500,000 and $20,000,000. JUA contracted with St. Paul Fire & Marine Insurance Company (St.Paul) to service and adjust claims against its insureds and provide them with a defense. As an excess carrier, IINA had no responsibility to provide MCH with coverage for the first $500,000 of any claim or with its primary defense.
The case eventually settled, and after paying $750,000 of the $1,250,000 settlement, IINA sued St. Paul and JUA for statutory and common law bad faith in the investigation, evaluation, and settlement of the Figueredo claim. On the sixth day of trial, in a motion to dismiss, JUA and St. Paul claimed immunity from suit under section 627.351(4)(c), Florida Statutes (1993). The motion was denied by the court, and the jury returned a verdict in favor of IINA. On appeal, the Fourth District affirmed and held that statutory immunity is an affirmative defense that does not implicate subject matter jurisdiction and must be pled or it is waived. Florida Medical Malpractice Joint Underwriting Ass'n, 652 So.2d at 1149. Although with some reluctance, we quash the district court decision.[1]
We conclude that this case presents a straightforward issue that is controlled by the Rules of Civil Procedure and by an express statutory provision. Section 627.351(4)(c), Florida Statutes (1993), provides in part:
(4) MEDICAL MALPRACTICE RISK APPORTIONMENT.
(c) ... There shall be no liability on the part of, and no cause of action of any nature shall arise against, any member insurer, self-insurer, or its agents or employees, the Joint Underwriting Association or its agents or employees, members of the board of governors, or the department or its representatives for any action taken by them in the performance of their powers and duties under this subsection.
(Emphasis added.) Further, Rule 1.140(h)(2), Florida Rules of Civil Procedure, expressly provides that "[t]he defenses of failure to state a cause of action or a legal defense ... may be raised ... at the trial on the merits."[2]
Petitioners argue that the immunity provision of section 627.351(4)(c) precludes any cause of action against them. They further assert that since a defense of failure to state a cause of action can be raised at trial under rule 1.140(h)(2), the trial court should have dismissed the bad faith claims against them.
It is undisputed that the petitioners specifically cited and quoted the relevant statutory provisions at trial in support of the motion to dismiss, hence properly asserting and preserving *1042 the claim of statutory immunity. The statute expressly states that "no cause of action of any nature" shall arise against the petitioners. This statute was actually quoted to the trial court. Rule 1.140 provides that the "no cause of action" defense may be raised at trial. Here, it was raised at trial. Hence, the motion to dismiss should have been granted.
Accordingly, we quash the decision below and remand with directions for further proceedings consistent herewith.
It is so ordered.
OVERTON, GRIMES, HARDING, WELLS and ANSTEAD, JJ., concur.
SHAW, J., concurs in result only.
NOTES
[1]  Our reluctance is based on the fact that the statute controlling the outcome of this case was not brought to the attention of the trial court much earlier in the proceedings.
[2]  Florida Rule of Civil Procedure 1.140 states in pertinent part:

(h) Waiver of Defenses
. . . .
(2) The defenses of failure to state a cause of action or a legal defense or to join an indispensable party may be raised by motion for judgment on the pleadings or at the trial on the merits in addition to being raised in either a motion under subdivision (b) or in the answer or reply. The defense of lack of jurisdiction of the subject matter may be raised at any time.
