
144 Wis.2d 655 (1988)
424 N.W.2d 714
Ludwig VRETENAR and Shirley Vretenar, Plaintiffs-Appellants,
v.
Richard HEBRON, Chairman of the Town of Raymond, and Richard Scott, Town Supervisor, Defendants-Respondents.
No. 87-0482.
Supreme Court of Wisconsin.
Argued May 31, 1988.
Decided June 24, 1988.
*657 For the plaintiffs-appellants there were briefs (in court of appeals) by James D. MacDonald and MacDonald *658 & Koss, Union Grove and oral argument by James D. MacDonald.
For the defendants-respondent there was a brief (in court of appeals) by Emily S. Mueller and Thompson & Coates, Ltd., Racine and oral argument by Emily S. Mueller.
STEINMETZ, J.
The issue in the case is whether the enforcement of town ordinances is a nondiscretionary, ministerial duty which can be compelled by mandamus. The trial court answered "no" and appellants, Ludwig and Shirley Vretenar, appealed to the court of appeals. We accepted the court of appeals certification of the issue to this court under sec. 809.61, Stats. We hold that because the plaintiffs sought a remedy that necessarily required the exercise of discretion by town officials, as a matter of law, plaintiffs could not meet the burden of establishing that mandamus should issue. The circuit court properly exercised its discretion in denying the writ; accordingly, we affirm that decision.
This is an appeal from a summary judgment entered February 4, 1987, in the Racine county circuit court by Judge Stephen A. Simanek which dismissed the plaintiffs' complaint for mandamus against officials of the town of Raymond. Plaintiffs sought a writ of mandamus compelling the defendants (1) to prosecute Glen Staege for the payment of certain forfeitures owed to the town of Raymond and, (2) to prosecute and enforce certain town ordinances against Glen Staege. Plaintiffs' motion for summary judgment alleged that the defendants had failed to perform nondiscretionary legal duties, that there was no genuine issue as to any material fact in regard thereto, and the plaintiffs were entitled to such *659 judgment as a matter of law. The trial court granted summary judgment in favor of defendants, the officials of the town of Raymond, ruling that mandamus would not lie to compel the discretionary acts sought by the plaintiffs.
This action arises out of a lengthy history of litigation involving the efforts of the town of Raymond to enforce its ordinances against residents Glen Staege. From 1982 the town has been involved in roughly a dozen separate hearings in the Racine county circuit court, traffic and misdemeanor court, and the United States bankruptcy court in its attempts to enforce the ordinances.
The town of Raymond commenced an action in June, 1982, by issuing citations to Glenn Staege (Staege) for violating sections of the town ordinances 2.05 (relating to the dumping and storage of rubbish) and 3.01 (relating to the operation of a business as a junk and motor salvage dealer without a license). Staege entered guilty pleas to both charges and was assessed a forfeiture of $200. Because Staege continued to violate the ordinances, the town thereafter commenced a civil action seeking an injunction against further code violations, requiring Staege to remove all rubbish, junk and salvage motor vehicles from his property, and prohibiting him from storing or maintaining such items unless licensed to do so by the town. A month later, the town issued citations against Staege for his continuing violations of both sections. Thereafter, following a hearing in the injunction action before Racine county circuit Judge Dennis J. Flynn, the court granted a preliminary injunction prohibiting further accumulation of rubbish onto Staege's property and ordering that all junk and *660 rubbish be placed in a one-acre parcel within 30 days of the hearing.
Staege and the town thereafter entered into a stipulation whereby Staege agreed to the entry of a permanent injunction prohibiting him from dumping and storing the rubbish and from operating as a motor salvage dealer in the town of Raymond. The stipulation provided for dismissal of the pending ordinance violation citations in the event Staege complied with the cleanup order by mid-June of 1983. When Staege failed to comply, Judge Flynn found him in contempt following a hearing on August 18, 1983, and authorized the town of Raymond to proceed with the removal and disposal of junk and rubbish from Staege's property. That order was clarified following another hearing on September 29, 1982.
In December of 1983, Judge Flynn held a two-day hearing on the motion of plaintiffs in this action, Ludwig and Shirley Vretenar (the Vretenars). The Vretenars acted as amicus curiae and sought contempt findings against the town and Staege for failing to comply with the order. The motions were denied by the court. Following arguments from both parties and the amicus, the court entered a supplemental order clarifying which "disputed" items of junk required removal. Further hearings were held on January 26 and April 6, 1984, to clarify the items that were required to be removed. Again the plaintiffs appeared and argued that more items should be removed from the premises. Staege appealed to the court of appeals from the final order entered by the court.
Staege's failure to comply with the terms of Judge Flynn's original order prompted the town to proceed with its prosecution of the ordinance violations. A trial was held on May 7, 1984, before Judge Emmanuel *661 Vuvunas in Racine county circuit court, and Staege was found guilty of continuing violations of secs. 3.01(2) and 2.05(2) of the Raymond code of ordinances and was ordered to pay fines totaling $7,980. Again the Vretenars appeared at the trial and were permitted to address the court prior to sentencing. Staege took an appeal from these convictions also.
On January 27, 1986, the court of appeals issued a decision confirming the conviction on the rubbish charge and reversing the conviction on the salvage business charge.
Days after the decision of the court of appeals, Staege filed bankruptcy proceedings pursuant to ch. 11 of the bankruptcy code. Attorneys for the town sought to have the fines assessed against Staege declared nondischargeable in bankruptcy but the federal court stay prohibited further proceedings to collect the forfeiture ordered by Judge Vuvunas.
The foregoing lengthly explanation of facts has been presented to illustrate the actions taken by town officials in their effort to apply the town ordinances to Staege. The town's efforts have yielded minimal results with respect to the removal of items identified as junk by Judge Flynn.
[1, 2]
When appropriate, a writ of mandamus can be used to compel the performance of an official act. It is a discretionary writ in that it lies within the sound discretion of the trial court to either grant or deny. Miller v. Smith, 100 Wis. 2d 609, 621, 302 N.W.2d 468 (1981). On appeal, this court will affirm the trial judge's actions in either granting or denying the writ unless the trial court abused its discretion. Id.
In Beres v. New Berlin, 34 Wis. 2d 229, 231-32, 148 N.W.2d 653 (1967), the court stated:

*662 "It is well settled that mandamus will not lie to compel the performance of an official act when the officer's duty is not clear and requires the exercise of judgment and discretion. Wisconsin Pharmaceutical Asso. v. Lee (1953), 264 Wis. 325, 58 N.W. (2d) 700. It is equally true that `mandamus is not a proper remedy to control the acts of municipal bodies when acting within the scope of their legal powers, on matters in respect of which they are vested with discretion ....' 55 C.J.S., Mandamus, p. 212, sec. 124 (2)."
[3]
A writ of mandamus will issue only when there is a clear legal right; the duty sought to be enforced is positive and plain; the applicant for the writ shows that he will be substantially damaged by nonperformance of the duty; there is no adequate specific legal remedy for the threatened injury; "`and no special reasons exist rendering a resort on his part to the remedy, under the circumstances, inequitable ....'" Miller, 100 Wis. 2d at 621. Mandamus is an extraordinary legal remedy, and the petitioner in an action seeking this remedy must establish that is based on a clear, specific legal right which is free from substantial doubt. Eisenberg v. ILHR Department, 59 Wis. 2d 98, 101, 207 N.W.2d 874 (1973).
[4, 5]
It is an abuse of discretion for a court to compel action through mandamus when the duty to act is not clear and unequivocal and requires the exercise of discretion. State ex rel. La Follette v. Board of Supvrs., 109 Wis. 2d 621, 626-27, 327 N.W.2d 161 (Ct. App. 1982). Mandamus is not a proper remedy to control acts of municipal bodies when acting within the scope *663 of their legal powers on matters of which they are vested with discretion. Beres, 34 Wis. 2d at 229.
The threshold question, then, is whether the prosecution and enforcement of municipal ordinance violations are discretionary duties such that their performance cannot be compelled through mandamus. We find that they are.
[6]
In general, the duty to prosecute is vested with discretion as to the manner in which it is exercised. See generally Unnamed Petitioners v. Connors, 136 Wis. 2d 118, 401 N.W.2d 782 (1987); State ex rel. Kurkierewicz v. Cannon, 42 Wis. 2d 368, 166 N.W.2d 255 (1969). The authority to prosecute has not been held to constitute a ministerial duty that would bring it within the purview of actions compellable by mandamus.
In Kurkierewicz, 42 Wis. 2d at 379, we stated that: "The district attorney's function, in general, is of a discretionary type, the performance of which is not compellable in mandamus." The court also stated: "`[I]t is an abuse of discretion for a court to compel action through mandamus when the officer's duty is not clear and unequivocal and requires the exercise of the officer's discretion.'" Id. at 376. Citing Menzl v. Milwaukee, 32 Wis. 2d 266, 275, 145 N.W.2d 198 (1966).
As we stated in Locklear v. State, 86 Wis. 2d 602, 609, 273 N.W.2d 334 (1979), a prosecutor is accorded a broad range of discretion with respect to the enforcement of ordinances and statutes. The discretionary nature of a prosecutor's duty was discussed in State v. Karpinski, 92 Wis. 2d 599, 607, 285 N.W.2d 729 (1979), as follows:

*664 "This court has repeatedly emphasized that the prosecutor has great discretion in determining whether to commence a prosecution. While it is the prosecutor's duty to prosecute criminal actions, sec. 59.47, Stats., the prosecutor is not required to prosecute all cases in which it appears that the law has been violated. We have characterized the prosecutor's charging discretion as `quasi-judicial' in the sense that it is his duty to administer justice rather than to obtain convictions." (Footnote omitted.)
[7]
At the summary judgment hearing, the plaintiffs' attorney declared he did not maintain that the town lacks prosecutorial discretion. However, the plaintiffs argue for the first time on appeal that town board members lack prosecutorial discretion with respect to the prosecution and enforcement of the ordinances. The plaintiffs would have us distinguish between the prosecutorial duties of district attorneys and those of town board members acting through the town attorney. We reject this distinction. While the former involves criminal laws and the latter involves civil forfeiture ordinances, the prosecutorial duties are similar in that each is responsible for pursuing with discretion violations of laws under the office's jurisdiction.
The town board, acting through the town attorney, is not required to prosecute every infraction of the municipal ordinance code. As we stated in Kurkierewicz:
"There is no obligation or duty upon a district attorney to prosecute all complaints that may be filed with him. While it is his duty to prosecute criminals, it is obvious that a great portion of the *665 power of the state has been placed in his hands for him to use in the furtherance of justice, and this does not per se require prosecution in all cases where there appears to be a violation of the law no matter how trivial." 42 Wis. 2d at 378. (Footnote omitted.)
[8]
Similarly, there is no obligation on the part of municipal officials to prosecute all cases in which an individual commits a violation of the municipal ordinance code. See Karpinski, 92 Wis. 2d at 612. This is true notwithstanding, as the plaintiffs claim, that the violation is open and notorious. To hold otherwise would be tantamount to divesting a municipality of the discretion necessary for effective and efficient law enforcement. This we decline to do.
[9]
We likewise reject plaintiffs' argument that, while town officials have discretion to enact or modify ordinances, once they are enacted, all discretion of the town board ends with respect to enforcement and prosecution of the laws. Plaintiffs base this assertion upon their interpretation of selected powers of the town board: first, that the town chairman is empowered by statute to "[s]ee that town orders and ordinances are obeyed," sec. 60.24(1)(e)1, Stats.; and second, that the town constable has been empowered by the town board "to enforce all local ordinances." Sec. 60.35. However, the statutory duties of the district attorney are also preceded by the mandatory word "shall." Section 59.47 provides that the district attorney "shall ... [p]rosecute all criminal actions before any court for her or his county ...." This court has not interpreted this language to limit in any way the *666 prosecuting attorney's discretion on whether to prosecute a particular case.
[10]
While mandamus may be appropriate in some circumstances to compel a governmental body to exercise discretion in the first instance, this remedy will not lie to control the manner in which the discretion is exercised. See State ex rel. Thomas v. State, 55 Wis. 2d 343, 198 N.W.2d 675 (1972); Slawek v. Stroh, 62 Wis. 2d 295, 215 N.W.2d 9 (1974). Only where the legislature has designated limits of the prosecutorial discretion and defined situations in which the governmental body must act can performance be compelled through mandamus. Kurkierewicz, 42 Wis. 2d at 380.
[11]
Moreover, under the facts of this case it is clear that the town of Raymond has taken action on numerous occasions and spent substantial sums of money in its attempts to compel Staege's compliance with the code. Thus, contrary to plaintiffs' claim, defendants have exercised discretion with respect to this continuing problem. Basically, plaintiffs' argument here is not that the town has failed to exercise discretion with respect to this matter; rather, it is a complaint that the town did not go further in its attempt to enforce the ordinances. We are not without sympathy for the frustration experienced by the Vretenars and other neighboring residents regarding Staege's activities. However, the law is clear that mandamus will not lie to compel the manner in which a governmental body exercises discretion. As we stated in Kurkierewicz, 42 Wis. 2d at 378-79, there are political remedies, i.e., recall or defeat at the polls, that can be exercised against public officials who *667 perform their duties in a manner with which the public disagrees.
[12]
With respect to the issue of forfeiture collection for the fines already imposed, the circuit court also properly denied the writ of mandamus. There is no question but that Glenn Staege owes the town of Raymond substantial sums of money as a result of his conviction by Judge Vuvunas for violation of town ordinances. It is also undisputed that an order of the bankruptcy court prohibited any further action by the town of Raymond pending resolution of certain issues in Staege's federal bankruptcy proceedings. Until that stay is lifted, the town is legally precluded from proceeding further with respect to the collection of the forfeitures.
Accordingly, the plaintiffs cannot compel the town officials to perform acts which (1) they are precluded from performing by virtue of a stay of the United States Bankruptcy Court for the Eastern District of Wisconsin; and (2) constitute discretionary acts and not ministerial duties. The circuit court properly exercised its discretion in denying plaintiffs remedy; indeed, any other decision would have constituted an abuse of discretion.
By the Court.The judgment of the Racine county circuit court is affirmed.
