
486 N.W.2d 589 (1992)
STATE of Iowa, Appellant,
v.
Verle A. MORET, Appellee.
No. 91-1843.
Supreme Court of Iowa.
June 17, 1992.
*590 Bonnie J. Campbell, Atty. Gen., David A. Ferree, Sp. Asst. Atty. Gen., Mark Hunacek, Asst. Atty. Gen., and Michael E. Thole, Sp. County Prosecutor, for appellant.
Randy L. Waagmeester of DeWaay & Waagmeester, Rock Rapids, for appellee.
Considered by SCHULTZ, P.J., and LAVORATO, NEUMAN, SNELL and ANDREASEN, JJ.
ANDREASEN, Justice.
The State appeals from an order of a district associate judge dismissing an habitual offender petition because the defendant had established his laches defense. The State challenges the decision on the ground that a district associate judge does not have jurisdiction of civil habitual offender proceedings. We treat this challenge as an action for writ of certiorari. Because there is no constitutional or statutory authority for the district associate judge's assertion of jurisdiction over an habitual offender proceeding, we sustain and remand the case to the district court.

I. Background.

On July 21, 1991, the State filed a petition asking the court to determine that Verle Moret was an habitual offender of the motor vehicle laws as defined in Iowa Code section 321.555 (1991). Attached to the petition was a certified copy of Moret's driving record and a certified abstract of convictions. Iowa Code §§ 321.556-.558.
The abstract showed that Moret had been convicted of driving while intoxicated (DWI) on three separate occasions in South Dakota. The three South Dakota convictions were entered between January and June 1989. The abstract also showed a January 1991 Iowa conviction for driving while under suspension or revocation. Based upon the filing of a petition and abstract by the special county prosecutor, a district judge issued a show cause order as to why Moret should not be barred from operating a motor vehicle within the State of Iowa. Iowa Code § 321.558.
The hearing was scheduled before a district associate judge. At the hearing on August 27, 1991, the State introduced Moret's driving record and abstract of convictions. Iowa Code § 321.557. Moret admitted he was the person convicted of the identified offenses.
In his defense, Moret urged that he had voluntarily submitted to inpatient treatment and had addressed his substance abuse problem. He testified that he needed his driver's license for his farming operation and to transport his son.
After the close of the evidence, Moret's attorney stated that he was "relying upon the defense of laches, or unclean hands, or timeliness." In support of this assertion, the attorney continued:
We believe that it's grossly unfair and inequitable for these proceedings to be brought against this defendant at this time, initiated by the Iowa Department of Transportation, when the Department of Transportation has had this information available for quite some time.
Mr. Moret, through his testimony, has already established that he has been unable to drive for the past year and a half. Now, if he is found to be an habitual offender, the law requires a minimum suspension of an additional two years. And we think that is very unfair to Mr. Moret since he has already been suspended for a year and a half. Had the Iowa Department of Transportation in a timely fashion initiated these proceedings as early as a year ago, the suspension could be running concurrently and he would not be penalized by this further bar at the end, that would not be tacked on to the end, as they seek to do now.
In response, the special county prosecutor stated that he was not sure "that the license suspension would always run concurrently under section 321.555 as the other, under the driving while suspended or license being suspended as a result of operating while intoxicated."
The district associate judge apparently agreed with the arguments of Moret's attorney *591 and found that "the defendant has sustained his claim of laches by clear and convincing evidence, and accordingly, the above cause of action should be and the same is hereby dismissed at the cost of the state."
The State filed a motion for reconsideration which was denied by the district associate judge. This appeal followed.

II. Certiorari.

Certiorari lies when an inferior court is alleged to have exceeded its jurisdiction. State v. West, 320 N.W.2d 570, 573 (Iowa 1982). The State in its appeal argues that district associate judges do not have subject matter jurisdiction over habitual offender proceedings. The State asks that the decision be vacated.
Iowa Rule of Appellate Procedure 304 provides:
If any case is brought by appeal, certiorari, or discretionary review, and the appellate court is of the opinion that another of these remedies was the proper one, the case shall not be dismissed, but shall proceed as though the proper form of review had been sought. Any one of the foregoing remedies may under this rule be treated by the appellate court as the one it deems appropriate.
We are of the opinion that this appeal should be classified as a certiorari action because it challenges the authority of the district associate judge. See, e.g., West, 320 N.W.2d at 573. See also Iowa City v. Iowa Dist. Ct., 456 N.W.2d 178 (Iowa 1990) (certiorari action challenging authority of magistrate); Wilson v. Iowa Dist. Ct., 297 N.W.2d 223 (Iowa 1980) (certiorari action challenging authority of district judge). A challenge to subject matter jurisdiction can be raised for the first time on appeal. Hutcheson v. Iowa Dist. Ct., 480 N.W.2d 260, 262 (Iowa 1992). Accordingly, we grant the writ and proceed.

III. Subject Matter Jurisdiction.

In Iowa we have a unified court, the district court. Iowa Code § 602.6101. The jurisdiction of the district court is exercised by district judges, district associate judges, and magistrates. Iowa Code § 602.6104(1). Iowa City, 456 N.W.2d at 181. Although the district court has subject matter jurisdiction of habitual offender proceedings, district associate judges have authority to exercise only that jurisdiction provided by statute. See, e.g., In re R.A.R., 464 N.W.2d 883, 884 (Iowa 1991); Fisher v. Sedgwick, 364 N.W.2d 183, 184 (Iowa 1985).
Iowa Code section 602.6306 provides district associate judges with the authority to hear and decide certain subject matters or classes of cases. District associate judges have jurisdiction provided for magistrates. Iowa Code § 602.6306(1). Magistrates do not have the authority to conduct habitual offender proceedings. Iowa Code § 602.6405.
In addition to the authority of magistrates,
[d]istrict associate judges also have jurisdiction in civil actions for money judgment where the amount in controversy does not exceed five thousand dollars, jurisdiction of indictable misdemeanors, and felony violations of section 321J.2.
Iowa Code § 602.6306(2).
Adjudication as an habitual offender is not an indictable misdemeanor, nor is it a felony violation of section 321J.2. It is an action that is civil in nature. State v. Robbins, 257 N.W.2d 63, 66 (Iowa 1977). "The suspension of licenses of habitual offenders is designed, not to punish the offender, but to protect the public from those who persistently refuse to obey the statute[s]." State v. Marvin, 307 N.W.2d 10, 12 (Iowa 1981). Although the action is civil in nature, it is not one for money judgment as is required by the jurisdictional statute. As provided in Iowa Code section 321.559:
If the court finds that the defendant is an habitual offender, the court shall by appropriate judgment direct that such person not operate a motor vehicle upon the highways of this state for the period specified in section 321.560.
Accordingly, under the plain meaning of the statute conferring jurisdiction, Iowa Code § 602.6306, a district associate judge *592 is without authority to hear and determine habitual offender proceedings.
When a district judge is unable to serve as a result of temporary incapacity, a district associate judge may, by order of the chief judge of the judicial district, temporarily exercise any judicial authority of a district judge during the time of incapacity. Iowa Code § 602.6306(3). The record does not reflect that district associate judge Arnold was acting pursuant to order of the chief judge of the district at the time of the hearing on August 27, 1991. We sustain the writ of certiorari.

IV. Laches.

We address the laches issue to assist the district judge when addressing this defense in the remanded hearing. Although we have never directly addressed the question of whether laches can be used as a defense in habitual offender proceedings, we have implicitly approved of its use. See State v. Peterson, 347 N.W.2d 398, 404 (Iowa 1984). In Peterson, we identified the essential elements of this affirmative defense that must be proven by clear and convincing evidence. Id. We noted the defendant did not prove he was prejudiced by delay. Id. Nothing in the record indicated the State intended to deprive the defendant of his driving privileges for more than the period of up to six years as authorized by statute. Id.
Iowa Code section 321.560 gives a district judge the discretion to bar a violator from obtaining a license from two to six years from the date of judgment in the habitual offender action. In determining the period of time the habitual offender is to be barred, we think it is appropriate for the district judge to consider the time at which the petition was brought by the State in relation to the dates of convictions as shown on the abstract.
Moret has requested that costs and attorney fees be assessed to the State. We decline to allow attorney fees but assess costs to the State. Iowa R.App.P. 28.
WRIT SUSTAINED; CASE REMANDED.
