
495 N.W.2d 751 (1993)
CITY OF GRIMES, Appellant,
v.
POLK COUNTY BOARD OF SUPERVISORS and Des Moines Metropolitan Area Solid Waste Agency, Appellees.
No. 91-1580.
Supreme Court of Iowa.
February 17, 1993.
Thomas Henderson of Whitfield & Eddy, Des Moines, for appellant.
Eliza Ovrom, Asst. County Atty., for appellee Polk County.
James E. Brick of Brick, Seckington, Bowers, Swartz & Gentry, P.C., Des Moines, for appellee Agency.
Considered by HARRIS, P.J., and SCHULTZ, CARTER, LAVORATO and SNELL, JJ.
SCHULTZ, Justice.
Acting pursuant to its zoning ordinances, the Polk County Board of Supervisors (Supervisors) approved the grant of a conditional use permit to the Des Moines Metropolitan Area Solid Waste Agency (Agency) for the operation of a county compost facility. In a certiorari action, the City of Grimes (City) challenged the legality of the Supervisors' action. Following trial, the *752 district court dismissed the action. We reverse.
The Agency operates sanitary landfills serving all the communities of Polk County (County). Since 1972, the Agency has owned a 160-acre tract of land located approximately two miles southwest of the City. In 1972, the Agency obtained a conditional use permit from the Polk County Zoning Commission (Commission) permitting the use of the tract as a solid waste landfill. This action was challenged and affirmed by our court. Town of Grimes v. Board of Adjustment, Polk County, 243 N.W.2d 625 (Iowa 1976). However, the Agency did not construct a landfill on the tract.
In 1974, the City annexed the land around the Agency's site and the road leading to it. The City passed an ordinance placing a seven-ton weight restriction on trucks using the road. Garbage trucks used by the Agency to transport waste exceed this weight. The Agency is challenging the validity of that ordinance in a companion appeal decided this date. See Des Moines Metro. Area Solid Waste Agency v. City of Grimes, 495 N.W.2d 746 (Iowa 1993).
In 1990, the Agency applied to the Commission for a conditional use permit which would allow the Agency to use the tract in question as a yard waste compost facility. Following a hearing, the Commission granted the permit. The City appealed the decision to the Supervisors and a hearing was granted. The Supervisors affirmed the grant of the permit subject to a traffic study of the road leading to the tract, and on the condition that "the agency be required with the concurrence of the City ... to pay for upgrading of the roadway caused by the use brought about by this conditional use permit." This ruling is the subject of the certiorari action.
A writ of certiorari shall be granted where an inferior board exercising judicial functions is alleged to have acted illegally. Iowa R.Civ.P. 306. Certiorari is the appropriate means to review a board of supervisors' zoning decision. Montgomery v. Bremer County Bd. of Supervisors, 299 N.W.2d 687, 692 (Iowa 1980).
An illegality is established if a board has not acted in accordance with a statute; if its decision was not supported by substantial evidence; or if its actions were unreasonable, arbitrary, or capricious. The plaintiff bears the burden to prove the illegality.
Norland v. Worth County Compensation Bd., 323 N.W.2d 251, 253 (Iowa 1982) (citations omitted). Our review of a district court certiorari ruling is for errors of law. Iowa R.App.P. 4.
The City urges that the Supervisors acted illegally by issuing the conditional use permit in violation of the County's zoning ordinances. The City claims the Supervisors approved a conditional use permit in an area planned for residential development. The City also urges that the Supervisors failed to require the Agency to provide information required by the zoning ordinances in its application for the permit.
I. Future residential use. The site of the proposed compost facility is zoned by the county as an agricultural district. The area surrounding and adjacent to the proposed site is within the City's limits and also is zoned for agricultural use. The City explains it has adopted a future-use plan that shows the surrounding and adjacent area to be zoned residential in the future and the use permit is incompatible with its future plans. The City maintains the Supervisors acted illegally in failing to follow ordinances which require consideration of proposed uses of adjoining property.
Under the County zoning ordinance, a disposal facility in an agricultural district is permitted upon approval of a conditional use permit. A conditional use permit is described under the zoning ordinance as:
Conditional uses are those uses which have some special impact or uniqueness such that their effect on the surrounding environment cannot be determined in advance of the use being proposed for a particular location. When such a use is proposed, a review by the Zoning Commission of the location, design, configuration, *753 and impact will be conducted, comparing the proposed use to fixed standards. The review determines whether the proposed use should be permitted by weighing public need for, and benefit to be derived from the use against the local impact which it may cause. The review shall consider the proposal in terms of:
a. Existing zoning and land use in the vicinity of the use; and
b. planned and proposed public and private developments which may be adversely affected by the proposed use; and
c. whether and to what extent the proposed use, at the particular location for which it is suggested, is necessary or desirable to provide a development which in the interest of the public or which will contribute to the general welfare of the area or Polk County; and
d. whether and to what extent all steps possible have been taken by the developer to minimize any adverse effects of the proposed use on the immediate vicinity and on the public health, safety and welfare in general.
....
Polk County Zoning Ordinance Division 4500. We recently observed:
the purpose of the special use permit is to bring flexibility to the rigid restrictions of a zoning ordinance, while at the same time controlling troublesome or somewhat incompatible uses by establishing, in advance, standards that admit the use only under certain conditions and standards that must be met.
Willett v. Cerro Gordo County Zoning Bd. of Adjustment, 490 N.W.2d 556, 560 (Iowa 1992).
The ordinances have established standards that must be met before a conditional use permit can be granted. Polk County Zoning Ordinance section 4510 requires the Commission "specifically [find] the proposed conditional use appropriate in the location for which it is proposed." It also requires the finding to be based on criteria that include consideration of adjacent property "as they now exist or as they may in the future be developed as a result ... of any other plan ... by ... other governmental agency having jurisdiction to guide growth and development."
We must decide whether the decision made was supported by competent and substantial evidence. Montgomery, 299 N.W.2d at 692. In Montgomery, we stated:
In reviewing amendments to zoning ordinances, we presume they are valid and if their reasonableness is fairly debatable, we will not substitute our judgment for that of the legislative body.
Id. We will not interfere with the zoning decisions of a governmental entity unless there is a clear abuse of discretion. Incorporated City of Denison v. Clabaugh, 306 N.W.2d 748, 755 (Iowa 1981).
Division 4500 and section 4510 require a weighing of the public need and benefit of the proposed use against any adverse effect on adjacent property under its present or proposed use. In this case, the Agency is under statutory mandate to provide composting facilities. The land adjacent to the proposed compost facility site is sparsely populated; only two residences are located within a mile of the site. The present residential area of the City, a small city, is over one-and-a-half miles from the site. The adverse effect to adjacent landowners is minimal in an area zoned for agricultural use.
The compost facility may be incompatible with the City's plan to zone the area residential. However, the Agency obtained a use permit to operate a landfill on the site in 1972 which has never been annulled. The City's plans are in conflict with the operation of a landfill on the site. The Supervisors could have determined that the present need of the compost facility outweighed the City's uncertain plans. Accordingly, we conclude the Supervisors' decision to grant the permit was supported by substantial evidence and there was no clear abuse of discretion.
II. Ordinance violations. The City urges that the Supervisors acted illegally *754 in failing to require the Agency to comply with several subsections of Polk County's Zoning Ordinance, section 4605E, which addresses standards for "Disposal Uses," including yard waste compost facilities. Section 4605E specifies that an applicant for such a permit shall, in addition to what is otherwise required, provide certain plans and information. We only need to discuss a claimed violation of a setback requirement.
Section 4605E(2)(6) provides standards for disposal uses and requires a performance standard that "[n]o disposal ... shall be located within two-hundred (200) feet from any street right-of-way." The plans submitted by the Agency, and approved by the Supervisors, show a setback of one-hundred-fifty feet from the adjoining property and ninety feet from the street. The Supervisors urge the ordinance violation occurred on preliminary plans and the setback requirement would be enforced when the Agency submits final plans for the facility.
County ordinances promulgated pursuant to statutory authority are extensions of state statutes. Willett, 490 N.W.2d at 559. Such ordinances impose a mandatory or permissive duty on the applicant for a special use permit to comply with the ordinance. Id.
[I]f the prescribed duty is essential to the main objective of the statute, the statute ordinarily is mandatory and a violation will invalidate subsequent proceedings under it. If the duty is not essential to accomplishing the principal purpose of the statute but is designed to assure order and promptness in the proceeding, the statute ordinarily is directory and a violation will not invalidate subsequent proceedings unless prejudice is shown.
Taylor v. Department of Transp., 260 N.W.2d 521, 522-23 (Iowa 1977).
The setback requirement is a duty imposed on the applicant. The question is whether the duty is mandatory. A failure to perform a mandatory duty will invalidate subsequent proceedings. Taylor, 260 N.W.2d at 522-23.
The duty to comply with the 200-feet setback requirement is essential to effect the main purpose of the conditional use ordinance. The Commission, and the Supervisors on review, must determine the impact of the use by considering the location and its impact and effect on adjoining land. The present plans show the property's topography and possible drainage problems. The impact of moving the site one-hundred-and-ten feet to comply with the setback requirement is unknown. To approve plans that do not currently conform to setback requirements is tantamount to acting in the dark. The City does not know whether a 200-foot setback would be feasible in terms of its effect on adjacent property. The Supervisors' approval of a plan violating its setback ordinance invalidates its action.
The district court erred in dismissing the certiorari action. On remand, the court shall enter an order invalidating the action of the Supervisors in approving the use permit obtained by the Agency.
REVERSED AND REMANDED.
