
688 N.W.2d 790 (2004)
Steve L. PFISTER and Scott Mariner, Plaintiffs,
v.
IOWA DISTRICT COURT FOR POLK COUNTY, Defendant.
No. 02-1513.
Supreme Court of Iowa.
November 10, 2004.
*791 Scott A. Sobel of Sobel Law Firm, Des Moines, for plaintiffs.
*792 Thomas J. Miller, Attorney General, John R. Lundquist and Chantelle C. Smith, Assistant Attorneys General, and Josh Henningsen, Student Legal Intern, for defendant.
TERNUS, Justice.
In the 2002 legislative session, the Iowa General Assembly adopted several amendments to the Iowa Code addressing the appointment of state-paid counsel for indigent persons alleged to have violated parole. In the matter before us, the district court ruled the amendments were unconstitutional to the extent they denied court-appointed counsel to indigent parolees who would otherwise be entitled to such counsel under the principles set forth in Gagnon v. Scarpelli, 411 U.S. 778, 93 S.Ct. 1756, 36 L.Ed.2d 656 (1973). The court concluded, however, that the amendments eliminating the involvement of the public defender's office in providing representation and removing authorization for payment of court-appointed counsel from that office's budget did not violate parolees' constitutional rights. Based on these conclusions, the court denied court-appointed counsel's motions to withdraw in these parole revocation proceedings, but held "such representation shall not be reimbursed from any public funding source."
This court granted the plaintiffs' petition for writ of certiorari. We think the district court erred in concluding court-appointed counsel was not entitled to be compensated by the state. Finding no other illegality in the district court's ruling, we sustain the writ in part and annul the writ in part. We remand the case for further proceedings.

I. Background Facts and Proceedings.

Prior to the 2002 legislative session, Iowa Code section 908.2 required that an alleged parole violator "be advised of the right to appointed counsel under rule 26 of the rules of criminal procedure." Iowa Code § 908.2 (2001). Iowa Rule of Criminal Procedure 26 (renumbered as rule 2.28) provided that every indigent defendant was "entitled to have counsel appointed to represent the defendant at every stage of the proceedings ... including probation and parole revocation hearings...." To ensure that such counsel was readily available, the general assembly had authorized the public defender to "provide for the representation of indigents in proceedings instituted pursuant to chapter 908," the chapter governing violations of parole and probation. Iowa Code § 13B.4(1) (2001). Costs associated with such representation were authorized to be paid from funds appropriated to the state public defender's office. See id. § 815.11 (authorizing payment of costs "incurred under ... the rules of criminal procedure on behalf of an indigent").
In 2002 the legislature amended several code provisions in an apparent effort to eliminate the right to counsel previously granted parolees in Iowa. Iowa Code section 908.4(2) (2001) was amended to provide that an alleged parole violator "shall not have the right to appointed counsel." 2002 Iowa Acts ch. 1067, § 21 (codified at Iowa Code § 908.4(2) (2003)). (The right to counsel in parole revocation hearings found in Iowa Rule of Criminal Procedure 2.28 was subsequently removed from that rule.) At the same time, the requirement that alleged parole violators be advised of their right to appointed counsel at their initial appearance was taken out of section 908.2. Id. § 20 (codified at Iowa Code § 908.2 (2003)). The 2002 legislation also eliminated the statutory authority for the state public defender's office to provide legal representation for indigent parolees, as well as the funding for such representation previously included in the budget for *793 that office. Id. §§ 1, 18 (codified at Iowa Code §§ 13B.4(1), 815.11 (2003)).
In response to these statutory changes, the state public defender's office instructed its contract attorneys to decline appointment for indigent representation in parole revocation matters after July 1, 2002, the effective date of the new legislation, and to seek to withdraw from any appointments made after this date. See generally Iowa Code § 13B.4(3) (2003) ("The state public defender may contract with persons admitted to practice law in this state for the provision of legal services to indigent persons.").
In early July 2002 contract attorney Scott Sobel was appointed to represent Steve Pfister and Scott Mariner in parole revocation proceedings. As directed by the state public defender's office, Sobel filed applications to withdraw as counsel in both cases, citing the recent statutory amendments. The district court considering the applications was concerned the amendments did not comport with an alleged parole violator's constitutional rights under the Gagnon case and so set the applications for hearing. In response to the order setting a hearing, the Iowa Board of Parole filed a response, contending the amendments were constitutional.
After the scheduled hearing, the district court ruled that the amendments to Iowa Code sections 908.2 and 908.4(2) were squarely at odds with Gagnon because "parolees are neither provided a vehicle to request counsel in those cases where counsel may be required, nor would they be appointed counsel where they would otherwise be entitled to representation." The court concluded these amendments violated the United States and Iowa Constitutions to the extent the amendments denied alleged parole violators their right to court-appointed counsel. The district court held the amendments pertaining to funding and the involvement of the state public defender's office in parole revocation proceedings did not violate parolees' constitutional rights and therefore should stand. In supplemental orders the court held that "any required court appointments in parole revocation proceedings may be of any attorney licensed to practice in the state of Iowa" and that the responsibility of appointing counsel, when required, would rest with the judicial officer presiding over the alleged violator's initial appearance. With respect to attorney Sobel's applications to withdraw, the court denied his applications and held that any fees or costs associated with such representation would not be paid by the State.
During the time Sobel's applications were under consideration by the district court, the plaintiffs were brought to hearing on their alleged parole violations. Both appeared without counsel. An administrative law judge (ALJ) revoked Pfister's parole, and based on the record before us, it appears his sentence was completed a short time later. The determination on Mariner's parole revocation was continued by the presiding ALJ pending disposition of criminal charges in another matter. The record does not reveal that the issue of whether Mariner's parole should be revoked has been resolved.
The plaintiffs filed a petition for writ of certiorari, which the board resisted. See generally Iowa R.App. P. 6.301 (providing for original certiorari proceedings in supreme court). This court granted the writ, and the matter proceeded to briefing.
The plaintiffs appear to argue in their brief that all indigent alleged parole violators have a constitutional right to representation, not just some indigents as held by the district court. In addition, the plaintiffs challenge the court's determination that the State is not obligated to pay for such representation. The plaintiffs ask *794 that this court give no effect to the amendments denying the right to counsel to indigent alleged parole violators in parole revocation proceedings, and that we provide for reimbursement of counsel appointed to represent these parolees.
The Attorney General of Iowa filed a brief on behalf of the nominal defendant, the Iowa District Court for Polk County. Although ostensibly representing the district court, the Attorney General espouses the position of the Iowa Board of Parole in his brief. Therefore, we will refer to the board as the putative defendant.
The board points out that under Gagnon not all parolees have a constitutional right to appointed counsel in parole revocation matters. The board further asserts the amendment removing the requirement that alleged violators be advised of the right to appointed counsel is constitutional. Finally, the board asks this court to uphold the remainder of the district court's decision that the legislature constitutionally eliminated the responsibility of the state public defender's office for the legal fees of court-appointed counsel for indigent alleged parole violators.

II. Scope and Principles of Review.

A writ of certiorari lies where a lower board, tribunal, or court has exceeded its jurisdiction or otherwise has acted illegally. For this reason, this court "may examine only the jurisdiction of the district court and the legality of its actions." "Illegality exists when the court's findings lack substantial evidentiary support, or when the court has not properly applied the law." Our review of the district court's action is therefore for correction of errors of law.
State Pub. Defender v. Iowa Dist. Ct. for Black Hawk County, 633 N.W.2d 280, 282 (Iowa 2001) (citations omitted). If constitutional issues are raised, however, we independently evaluate the totality of the evidence, and our review is de novo. Brummer v. Iowa Dep't of Corrs., 661 N.W.2d 167, 171 (Iowa 2003).
When the constitutionality of a statute is challenged, "we presume the statute is constitutional and `give it any reasonable construction necessary to uphold it.'" State v. Anspach, 627 N.W.2d 227, 231 (Iowa 2001) (citation omitted). The party challenging the constitutionality of a statute has the burden to demonstrate there is no reasonable basis upon which the statute can be sustained. Id.

III. Constitutionality of 2002 Amendments to Chapter 908.

A. Right of indigent alleged parole violators to court-appointed counsel. We first address the constitutional parameters of this issue. The district court stated the challenged statutes violated the Sixth Amendment right to counsel under the United States Constitution and the comparable right to counsel found in article I, section 10 of the Iowa Constitution. See U.S. Const. amend. VI ("In all criminal prosecutions, the accused shall ... have the Assistance of Counsel for his defence."); Iowa Const. art. I, § 10 ("In all criminal prosecutions, and in cases involving the life, or liberty of an individual the accused shall have a right ... to have the assistance of counsel."). The same constitutional provisions are cited by the plaintiffs. Nonetheless, both the district court and the plaintiffs rely on case law discussing a parolee's rights, including the right to representation, as a component of due process: Gagnon v. Scarpelli, 411 U.S. 778, 93 S.Ct. 1756, 36 L.Ed.2d 656 (1973), and Morrissey v. Brewer, 408 U.S. 471, 92 S.Ct. 2593, 33 L.Ed.2d 484 (1972). See generally U.S. Const. amend. XIV (prohibiting states from depriving "any person of life, liberty, or property, without due *795 process of law"); Iowa Const. art. I, § 9 ("no person shall be deprived of life, liberty, or property, without due process of law"). Therefore, we limit our consideration of this issue to the requirements of the federal and state Due Process Clauses. Because the parties have articulated no basis for distinguishing these clauses for purposes of determining a parolee's right to counsel, our discussion of the federal due process claim applies equally to the claim made under the Iowa Constitution. See Maghee v. State, 639 N.W.2d 28, 30 (Iowa 2002) (refusing to distinguish due process right to counsel in disciplinary proceedings under Iowa Constitution from federal due process right to counsel); cf. In re Detention of Garren, 620 N.W.2d 275, 280 (Iowa 2000) (refusing to deviate from federal analysis in considering state constitutional claim because appellant "ha[d] suggested no legal deficiency in the federal principles ..., nor ha[d] he offered an alternative test or guidelines"). We turn now to the decisions of the United States Supreme Court addressing the due process rights of an alleged parole violator.
In Morrissey, the Supreme Court held the Due Process Clause requires a two-step process before an individual's parole can be revoked. 408 U.S. at 485, 92 S.Ct. at 2602, 33 L.Ed.2d at 496-97. First, there must be some minimal inquiry in the nature of a preliminary hearing to decide whether probable cause exists that the arrested parolee has committed a violation of his conditions of parole. Id. at 485, 92 S.Ct. at 2602, 33 L.Ed.2d at 496. Should a finding of probable cause be made, a revocation hearing must then be held to determine whether the facts show that a violation occurred and that revocation of parole is warranted. Id. at 487, 92 S.Ct. at 2603, 33 L.Ed.2d at 497-98. The Court held the parolee must have an opportunity to be heard at both hearings. Id. at 487-88, 92 S.Ct. at 2603, 33 L.Ed.2d at 497-98.
In Gagnon, the Supreme Court considered whether indigent parolees and probationers were entitled to the assistance of appointed counsel during proceedings instituted to revoke parole or probation. The Court noted the effectiveness of the protections guaranteed by Morrissey "may in some circumstances depend on the use of skills which the probationer or parolee is unlikely to possess." Gagnon, 411 U.S. at 786, 93 S.Ct. at 1762, 36 L.Ed.2d at 664. Concluding states were not "under a constitutional duty to provide counsel for indigents in all probation or parole revocation cases," the Court held a case-by-case determination must be made. Id. at 787, 93 S.Ct. at 1762, 36 L.Ed.2d at 664. The Court rejected the adoption of precise and detailed guidelines for when counsel was required, stating:
The facts and circumstances in preliminary and final hearings are susceptible of almost infinite variation, and a considerable discretion must be allowed the responsible agency in making the decision. Presumptively, it may be said that counsel should be provided in cases where, after being informed of his right to request counsel, the probationer or parolee makes such a request, based on a timely and colorable claim (i) that he has not committed the alleged violation of the conditions upon which he is at liberty; or (ii) that, even if the violation is a matter of public record or is uncontested, there are substantial reasons which justified or mitigated the violation and make revocation inappropriate, and that the reasons are complex or otherwise difficult to develop or present. In passing on a request for the appointment of counsel, the responsible agency also should consider, especially in doubtful cases, whether the probationer appears *796 to be capable of speaking effectively for himself.
Id. at 790, 93 S.Ct. at 1764, 36 L.Ed.2d at 666 (emphasis added).
From these cases, we conclude the federal constitution requires that alleged parole violators be informed of their right to request counsel. In addition, when the circumstances of a particular case meet the standard set forth in Gagnon, due process requires that counsel be appointed to represent indigent parolees.
B. Assessment of 2002 amendments to chapter 908 under constitutional requirements of Due Process Clause. We think the board is correct when it argues the legislature intended the 2002 amendments to eliminate the blanket right to counsel previously granted parolees under Iowa law. We disagree, however, with its assertion that the amendment to section 908.4(2) can be interpreted as removing the statutory right to counsel, but leaving intact the limited constitutional right to counsel recognized in Gagnon. Amended section 908.4(2) states unequivocally that an alleged parole violator "shall not have the right to appointed counsel." If applied as written, which the courts are obligated to do, the statute leaves no room for the appointment of counsel in any parole revocation proceeding. See generally Teggatz v. Ringleb, 610 N.W.2d 527, 530 (Iowa 2000) (holding "if the terms of the statute are explicit, the plain meaning of the language will be applied [and] we will simply give effect to the statute as written" (citation omitted)). Therefore, we agree with the district court that the amendment to section 908.4(2) violates the due process rights of indigent parolees who meet the test for appointment of counsel set forth in Gagnon.
On the other hand, we reject the plaintiffs' contention that the statute is unconstitutional in all applications. The plaintiffs' underlying premise  that all indigent alleged parole violators have the right to appointed counsel  is simply wrong. The Supreme Court made it clear in Gagnon that not all parolees have a due process right to counsel. See Gagnon, 411 U.S. at 787, 93 S.Ct. at 1762, 36 L.Ed.2d at 664 (stating "the Court of Appeals erred in accepting respondent's contention that the State is under a constitutional duty to provide counsel for indigents in all probation or parole revocation cases"). Therefore, the legislature did not violate the constitution by eliminating a right to counsel for indigent parolees who do not meet the Gagnon criteria. See Gacke v. Pork Xtra, L.L.C., 684 N.W.2d 168, 174 (Iowa 2004) (holding statute "may be enforced to the extent it operates constitutionally"); accord Iowa Code § 4.12 (2003).
In view of the fact that not all alleged violators have a right to court-appointed counsel, there is no constitutional infirmity in the amendment to section 908.2 eliminating the requirement that parolees be informed of their right to appointed counsel. We note, however, that all parolees should be advised at their initial appearance that they have a right to request counsel. Only then will a parolee be in a position to assert a right to counsel, so as to trigger an inquiry by the court into whether the circumstances show the parolee is in fact constitutionally entitled to representation.

IV. Funding of Court-Appointed Counsel for Indigent Parolees.

The district court ruled the amendments revoking authority for the state public defender to represent indigent alleged parole violators and removing authorization to pay for such representation from the appropriation made to the state public defender's office were constitutional. *797 The court also concluded that with the elimination of this source for payment, there was no public funding available to pay for constitutionally required indigent defense in parole revocation proceedings.
The plaintiffs do not challenge the constitutionality of the amendment directed to the participation of the state public defender in providing representation where mandated by Gagnon, but they do assert it violates parolees' due process rights when the state refuses to pay for appointed counsel. The board responds that while it has no stake in the issue of payment for appointed counsel, "there is support for the district court's decision that no source [for payment] exists." Notwithstanding such support, the board does not dispute that funding may be available elsewhere. It argues, however, that because "[t]he district court only considered funding mechanisms set forth in Iowa Code chapter 815," this court should not go beyond that chapter in searching for possible funding sources.
Unlike our analysis of the right-to-counsel issue, which applied equally to the federal and state constitutional claims, our discussion of the issue of payment for court-appointed counsel focuses on state constitutional law. We rely on cases interpreting state constitutional requirements because, as our subsequent discussion explains, these cases require that court-appointed attorneys in proceedings instituted by the state be compensated from the public fisc. Therefore, we need not consider whether the federal constitution requires a state to pay for constitutionally mandated counsel. See Bolyard v. Berman, 274 N.J.Super. 565, 644 A.2d 1122, 1129 (N.J.Super.Ct.App.Div.1994) (holding "Gagnon does not require that counsel assigned to represent indigent parolees be compensated by the State").
Initially, we note the inapplicability of the Maghee case upon which the board relies for its statement that there exists support for the district court's decision that the state has no obligation to pay court-appointed counsel. See Maghee, 639 N.W.2d at 31. In Maghee, we determined that inmates did not have a constitutional right to counsel in disciplinary proceedings. Id. at 30. This court went on to state that even if the district court had "the inherent power to appoint counsel to assist the court in conducting a proceeding," that power did not necessarily carry "with it the power to order the state to compensate counsel thus appointed." Id. at 31 (emphasis added). Thus, the issue in Maghee was whether the court had inherent power to appoint counsel and to order counsel's payment at public expense. In contrast, here, we are concerned with whether constitutionally required counsel must be paid by the state. Maghee is inapposite.
More on point is our decision in McNabb v. Osmundson, 315 N.W.2d 9 (Iowa 1982). In McNabb, we held an indigent facing a possible jail sentence for contempt for nonpayment of child support had a due process right to an attorney. 315 N.W.2d at 11, 14. We concluded this entitlement included a right to court-appointed counsel in an original certiorari action in the supreme court to challenge the district court's decision in the contempt action. Id. at 15. Although no statutory authority existed for payment of the indigent's attorney fees in the appellate court proceeding, we noted that "[s]ince 1850 Iowa has stood among that strong minority of states ... holding lawyers compelled to represent indigents must receive reasonable compensation." Id. at 16. We concluded, therefore, that when the constitution mandates the appointment of counsel, the state has a concomitant responsibility to pay the court-appointed attorney. Id. at 16-17. *798 Although this obligation is limited to those proceedings brought by the state in the public interest, see Lalla v. Gilroy, 369 N.W.2d 431, 433-34 (Iowa 1985), it applies to fees incurred in district court proceedings, as well as fees incurred in the appellate courts, see Lunde v. Ruigh, 356 N.W.2d 566, 568 (Iowa 1984). See generally State Pub. Defender v. Iowa Dist. Ct. for Muscatine County, 594 N.W.2d 38, 40 (Iowa 1999) (holding counsel appointed under McNabb reasoning must be compensated using as a benchmark rates set in Iowa Code section 815.7).
Notwithstanding the state's obligation to pay the fees of constitutionally required counsel, there is no constitutional infirmity in the amendment to section 815.11, which eliminates the state public defender's responsibility for court-appointed counsel fees in parole revocation matters. This conclusion is based on the fact there continues to be statutory authority for the payment of such fees. Iowa Code section 815.1, entitled "Costs payable by state in special cases," provides:
All costs and fees incurred in a parole revocation proceeding ... are waived if the prosecution fails, or if the person liable to pay the costs and fees cannot pay the costs and fees. An award of attorney fees to a court-appointed attorney incurred in these cases shall be paid out of the state treasury from the general fund if the prosecution fails or if the person liable to pay the attorney fees cannot pay them.

Iowa Code § 815.1 (2003) (emphasis added). Thus, there is statutory authority for payment from the general fund of court-appointed counsel's fees in parole revocation proceedings when the parolee is indigent. See generally State v. Iowa Dist. Ct. for Lyon County, 348 N.W.2d 221, 224 (Iowa 1984) (noting in cases specified in section 815.1, State is liable for attorney fees); State v. Iowa Dist. Ct. of Sioux County, 286 N.W.2d 22, 24 (Iowa 1979) (same).
Even though we disagree with the district court's conclusion that the legislature has not provided for payment of court-appointed counsel in these matters, we find no error in the district court's ultimate ruling that the amendments to section 13B.4(1) and section 815.11 are constitutional. These amendments simply changed the mechanics of providing and paying counsel for indigent parolees; instead of relying on the state public defender's office and budget, the court must now appoint private attorneys who will be paid from the general fund. Because the court is not precluded from appointing counsel when constitutionally required or from providing for payment of such counsel, there is no infringement on parolees' due process rights by the amendments to sections 13B.4(1) and 815.11.

V. Summary.

Amended section 908.4(2) violates the Due Process Clause only insofar as it denies court-appointed counsel to indigent parolees entitled to representation under the Gagnon decision. To the extent the amended statute eliminates the right to counsel of parolees who are not constitutionally entitled to an attorney, the amendment is effective. Although due process does not require that alleged parole violators be advised they have a right to appointed counsel, they must be advised at their initial appearances that they have the right to request counsel. If representation is requested and the court determines that counsel is warranted under the Gagnon standards, an attorney must be appointed by the court and paid by the state. Based on these conclusions, we sustain the writ with respect to the district court's ruling that court-appointed counsel's fees are not *799 payable with public funds. We annul the writ in all other particulars.
WRIT SUSTAINED IN PART AND ANNULLED IN PART. CASE REMANDED.
All justices concur except WIGGINS, J., who takes no part.
