
360 N.W.2d 729 (1985)
CITY OF DES MOINES, Iowa, Appellee,
v.
DES MOINES POLICE BARGAINING UNIT ASSOCIATION, Appellant.
No. 83-1245.
Supreme Court of Iowa.
January 16, 1985.
*730 Arthur C. Hedberg, Jr., and Phillip Vonderhaar, Des Moines, for appellant.
John L. Ayers, Sp. Asst. City Atty., and Nelda Barrow Mickle, City Sol., for appellee.
Considered en banc.
McCORMICK, Justice.
This case started in district court as an original action to obtain a declaratory judgment concerning the validity of a provision in a collective bargaining agreement. Plaintiff City of Des Moines contended that a provision in its 1982-83 collective bargaining agreement with defendant Des Moines Police Bargaining Association was illegal because it constituted a retirement system within the meaning of Iowa Code section 20.9 (1981). The district court overruled a special appearance in which the association alleged the City had not exhausted administrative remedies. The court then adjudicated the merits of the case in the City's favor, and the association appealed. Although the association did not raise the jurisdictional issue in its appeal, we raise the issue on our own motion. Because we find the district court should not have taken jurisdiction of the case, we vacate the judgment and remand the case for dismissal.
We first explain why we raise the jurisdictional issue on our own motion. Every court has inherent power to determine whether it has jurisdiction of the controversy before it. Jurisdiction of the proceeding cannot be conferred by waiver or consent, and courts have a duty to refuse on their own motion to decide controversies that are not properly before them. See Molitor v. City of Cedar Rapids, 360 N.W.2d 568, 569 (Iowa 1985); Qualley v. Chrysler Credit Corp., 261 N.W.2d 466, 468 (Iowa 1978). Specifically, when a party initiates a district court declaratory judgment action to obtain an adjudication entrusted exclusively in the first instance to an administrative agency, the action must be dismissed unless it is indistinguishable in substance from a petition for judicial review and all of the jurisdictional prerequisites for judicial review of agency action under Iowa Code section 17A.19 (1983) have been met. See Neumeister v. City Development Board, 291 N.W.2d 11, 13 (Iowa 1980).
The issue is technically not one of subject matter jurisdiction. A district court obviously has jurisdiction to entertain declaratory judgment actions. The issue is one of jurisdiction of the particular case. This is because a court lacks authority to entertain particular declaratory judgment suits in which its jurisdiction has not been properly invoked. See Wegman v. City of Iowa City, 279 N.W.2d 261, 264 (Iowa 1979) ("the jurisdiction of the district court to entertain such suits must be properly invoked"). Cases from other jurisdictions are in accord. See People v. Coit Ranch, Inc., 204 Cal.App.2d 52, 21 Cal.Rptr. 875 (1962); Denver-Laramie-Walden Truck Line, Inc. v. Denver-Fort Collins Freight Service, Inc., 156 Colo. 366, 399 P.2d 242 (1965); Pushkin v. Lombard, 279 So.2d 79 (Fla.Ct.App.1973); Secretary, Department of Human Resources v. Wilson, 286 Md. 639, 409 A.2d 713 (1979); Brog v. Commonwealth Department of Public Welfare, *731 43 Pa.Commw. 27, 401 A.2d 613 (1979).
A district court has broad but not unlimited power to grant declaratory relief. In relevant part, Iowa Rule of Civil Procedure 261 provides:
Courts of record within their respective jurisdictions shall declare rights, status, and other legal relations whether or not further relief is or could be claimed. It shall be no objection that a declaratory judgment or decree is prayed for. The declaration may be either affirmative or negative in form or effect, and such declarations shall have the force and effect of a final decree. The existence of another remedy does not preclude a judgment for declaratory relief in cases where it is appropriate.
The key language of the rule for purposes of the present case is the statement that "[t]he existence of another remedy does not preclude a judgment for declaratory relief in cases where it is appropriate."
While the existence of another remedy does not preclude a court from granting declaratory relief, the relief is not appropriate and must be denied when there is a complete remedy otherwise provided by law that is intended to be exclusive. Wright v. Thompson, 254 Iowa 342, 351, 117 N.W.2d 520, 525-26 (1962); Crews v. Collins, 252 Iowa 863, 867, 109 N.W.2d 235, 237 (1961); Herbst v. Treinen, 249 Iowa 695, 701, 88 N.W.2d 820, 824 (1958); Travelers Insurance Co. v. Sneddon, 249 Iowa 393, 401, 86 N.W.2d 870, 875 (1957); Rich Manufacturing Co. v. Petty, 241 Iowa 840, 846-49, 42 N.W.2d 80, 84-85 (1950).
In Rich the court recognized that when an administrative body exists for resolution of certain issues, such as by protesting a tax assessment to the board of review, declaratory relief is inappropriate because it would have the effect of ousting the statutory forum of its jurisdiction. This rule applies when an exclusive administrative remedy is provided: "The declaratory judgment procedure will not be used to preempt and prejudge issues that are committed for initial decision to an administrative body or special tribunal any more than it will be used as a substitute for statutory methods of review." 26 C.J.S. Declaratory Judgments § 17 at 85 (1956).
The question thus becomes whether an exclusive administrative remedy exists for the declaratory relief sought here. The exhaustion rule is inapplicable unless two conditions are met: "An administrative remedy must exist for the claimed wrong, and the statutes must expressly or impliedly require that remedy to be exhausted before resort to the courts." Rowen v. LeMars Mutual Insurance Co., 230 N.W.2d 905, 909 (Iowa 1975). Thus we must determine whether an adequate administrative remedy exists for the relief sought and, if so, whether the General Assembly intended that remedy to be exhausted before resort to the courts.
Essentially the City requests a declaratory ruling that the challenged contract provision constitutes a retirement system and is invalid. The City also asks that the provision "be stricken" as of the date of filing of the petition and that funds escrowed after that date be returned to the city treasurer.
Section 17A.9 of the Iowa Administrative Procedure Act provides:
Each agency shall provide by rule for the filing and prompt disposition of petitions for declaratory rulings as to the applicability of any statutory provision, rule or other written statement of law or policy, decision or order of the agency. Rulings disposing of petitions have the same status as agency decisions or orders in contested cases.
This provision is intended to allow a ruling on any species of law, however denominated, that is administered by the agency. It is the agency counterpart of judicial declaratory judgment procedures. Bonfield, The Iowa Administrative Procedure Act: Background, Construction, Applicability, Public Access to Agency Law, The Rulemaking Process, 60 Iowa L.Rev. 731, 822-23 (1975).
*732 We have recognized that this provision has been implemented by the Public Employment Relations Board. See PERB v. Stohr, 279 N.W.2d 286, 289 (Iowa 1979); 660 Iowa Admin.Code 10.1-10.6. The board has authority to conduct hearings when necessary in carrying out its responsibilities. See § 20.6(4). The issue here is exactly like those routinely decided by the board as negotiability disputes. See 660 Iowa Admin.Code 6.3. We have no reason to believe the PER board would be unable or unwilling to hear the petition for declaratory ruling and declare the rights of the parties as requested. If the board should refuse to rule, that decision is subject to judicial review. Stohr, 279 N.W.2d at 289. Moreover, section 17A.9 gives rulings the status of contested cases, and section 17A.19(1) provides:
If a declaratory ruling has not been rendered within thirty days after the filing of a petition therefor under section 17A.9, or if the agency declines to issue such a declaratory ruling after receipt of a petition therefor, any administrative remedy available under section 17A.9 shall be deemed inadequate or exhausted.
It therefore appears that an adequate administrative remedy exists. The remaining inquiry is whether the relevant statutes expressly or impliedly require that remedy to be exhausted before resort to the courts.
Section 17A.1(2) provides that the IAPA "is meant to apply to all rule-making and contested case proceedings and all suits for the judicial review of agency action that are not specifically excluded from this chapter or some portion thereof by its express terms or by the express terms of another chapter." A declaratory ruling or refusal to rule is agency action within the meaning of this provision. See 17A.2(9). Moreover, the language in section 17A.19(1) establishing a failure to rule or refusal to rule as exhaustion of the declaratory ruling remedy plainly confirms the existence of an exhaustion requirement.
Our cases have assumed that the declaratory ruling remedy must be exhausted before resort to the courts. See Women Aware v. Reagen, 331 N.W.2d 88, 90 (Iowa 1983); Stohr, 279 N.W.2d at 290. In fact, the issue was directly confronted in Stohr when the court held that persons who did not participate in the agency declaratory ruling proceeding could not join as petitioners for judicial review. The court said, "It is plain the individuals in question have not `exhausted all administrative remedies.'" 279 N.W.2d at 291.
It would be anomalous if exhaustion were not required. Most of the usual reasons for the requirement are present here:
The exhaustion requirement is both an expression of administrative autonomy and a rule of sound judicial administration. The agency is created as a separate entity, vested with its own powers and duties. The agency should be free, even when it errs, to work out its own problems. The courts should not interfere with the job given to it until it has completed its work. Premature interruption of the administrative process is no more justified than premature interruption of the trial process by interlocutory appeals. The agency, as the tribunal of first instance, should be permitted to develop the factual background upon which decisions should be based. Like the trial court, the agency should be given the first chance to exercise discretion and apply its expertness. In addition, judicial efficiency requires the courts to stay their hand while the party may still vindicate his rights in the administrative process. If he is required to pursue further agency remedies, the courts may never have to intervene.
B. Schwartz, Administrative Law § 172 at 498 (1976). Even though the declaratory ruling may be controlled by this court's decision in City of Mason City v. PERB, 316 N.W.2d 851 (Iowa 1982), it is appropriate for the agency in the first instance to interpret the statutes it administers. Even if the dispute is not resolved before the agency, the court upon subsequent review will have the benefit of the agency's insight into the problem.
*733 We recognize that the doctrine of exhaustion of administrative remedies is not absolute. See Salsbury Laboratories v. Iowa Department of Environmental Quality, 276 N.W.2d 830, 836-37 (Iowa 1979). In the present case, however, no exception applies. We find that the relevant statutes require exhaustion of the declaratory ruling procedure before resort to the courts. Thus both conditions for the exhaustion requirement are met.
We therefore have a mandatory duty to recognize that the jurisdiction of the district court was not properly invoked by the declaratory judgment action. Without prejudice to plaintiff's right to seek declaratory relief before the PER board, we vacate the district court judgment and remand the case for an order of dismissal.
JUDGMENT VACATED AND CASE REMANDED.
All Justices concur except CARTER, J., who dissents.
CARTER, Justice (dissenting).
I dissent. I do not believe that the availability of a declaratory ruling by the PERB in the present controversy affords the parties an adequate administrative remedy so as to require the exhaustion of that remedy.
