
248 Wis.2d 986 (2001)
2001 WI 136
637 N.W.2d 62
STATE of Wisconsin, Plaintiff-Appellant-Petitioner,
v.
Christopher Lee DAVIS, Defendant-Respondent.
No. 00-0889-CR.
Supreme Court of Wisconsin.
Oral argument November 6, 2001.
Decided December 27, 2001.
*992 For the plaintiff-appellant-petitioner the cause was argued by Michael R. Klos, assistant attorney general, with whom on the brief was James E. Doyle, attorney general.
For the defendant-respondent there was a brief and oral argument by Jane Krueger Smith, Oconto Falls.
¶ 1. SHIRLEY S. ABRAHAMSON, CHIEF JUSTICE.
This is a review of a published decision of the court of appeals, State v. Davis, 2001 WI App 63, 242 Wis. 2d 344, 626 N.W.2d 5, affirming an order of the Circuit Court for Dodge County, Daniel W. Klossner, Circuit Court Judge. The circuit court granted defendant Christopher Lee Davis's motion to dismiss the criminal case against him with prejudice because the State failed to bring the case on for trial within the *993 120-day time period set forth in Wis. Stat. § 971.11(2) (1999-2000).[1]
¶ 2. The court of appeals affirmed the circuit court's order, holding that the legislature intended that a circuit court have the discretion to dismiss a criminal case with or without prejudice when the State fails to bring the criminal case on for trial within the 120-day time period set forth in Wis. Stat. § 971.11(2).
¶ 3. Two questions of law are presented in this case. First, does Wis. Stat. § 971.11(7) grant a circuit court the discretion to dismiss a criminal case with or without prejudice when the State fails to bring the criminal case on for trial within the 120-day time period set forth in § 971.11(2)?[2] Second, if § 971.11(7) does grant a circuit court the discretion to dismiss a criminal case with or without prejudice when the State fails to bring the criminal case on for trial within the 120-day time period set forth in § 971.11(2), did the circuit court in the present case properly exercise its discretion in dismissing the criminal case against the defendant with prejudice?
[1]
¶ 4. This court decides both these questions of law independent of the circuit court and court of appeals, but benefiting from their analyses.
¶ 5. We agree with the court of appeals that when a criminal case is not brought on for trial within the 120-day time period set forth in Wis. Stat. § 971.11(2), a circuit court has the discretion under § 971.11(7) to *994 dismiss the criminal case with or without prejudice. We further conclude that the circuit court failed to properly exercise its discretion in the present case, and we remand the cause to the circuit court to exercise its discretion in determining whether the dismissal should be with or without prejudice.

I
¶ 6. The facts in the present case are undisputed. On March 16, 1999, a criminal complaint was filed in Dodge County Circuit Court alleging that Christopher Lee Davis, the defendant and an inmate at the Fox Lake Correctional Institution, was involved in a conspiracy to deliver marijuana at the correctional institution. Pursuant to Wis. Stat. § 971.11, commonly referred to as the Intrastate Detainer Act,[3] the defendant himself, not represented by counsel, requested a "prompt disposition" of his case. The defendant's request triggered the 120-day time period during which the State was to bring the criminal case against the defendant on for trial.
¶ 7. The district attorney's office received the defendant's request on March 23, 1999. Defense counsel was appointed for the defendant on April 22, 1999, and the defendant was represented throughout the proceedings. A preliminary hearing was scheduled for May 5, 1999, but the defendant waived his right to the hearing on a form executed that day. The defendant was arraigned on May 26, 1999, at which time the circuit court scheduled the case for a status conference to be held on *995 July 19, 1999. Following the status conference the circuit court entered orders on July 22, 1999, after the statutory 120-day period to bring the case on for trial had expired, scheduling a motion hearing on August 3, 1999, and a trial on November 16, 1999.
¶ 8. The State and the defense counsel filed a joint request for a continuance on July 28, 1999, so the motion hearing was rescheduled for October 18, 1999. The parties then filed a "Stipulation & Recommendation" on September 9, 1999, in which the defendant agreed to plead guilty to one count of conspiracy to deliver marijuana. In exchange for a sentence recommendation of two years, the defendant agreed to testify truthfully in any proceeding involving the delivery of drugs at Fox Lake Correctional Institution. The defendant executed a plea questionnaire and waiver of rights form on October 7, 1999, and the circuit court scheduled a plea and sentencing hearing for January 7, 2000.
¶ 9. However, in a letter to the circuit court dated January 3, 2000, defense counsel notified the circuit court that it had come to counsel's attention that the defendant had requested a prompt disposition of the criminal case against him pursuant to Wis. Stat. § 971.11 and that the district attorney's office had received this request on March 23, 1999. Defense counsel's letter explained that the request for prompt disposition was not on file with the clerk of courts[4] and that defense counsel had not received a copy from the district attorney. Defense counsel's letter then asked the circuit court to dismiss the criminal case with prejudice on the ground that the State failed to bring *996 the case on for trial within the 120-day time period set forth in § 971.11(2). One hundred twenty days from March 23, 1999, the date on which the district attorney's office had received the defendant's request for prompt disposition of the case, had elapsed on July 21, 1999.
¶ 10. On February 14, 2000, the circuit court held a hearing on the defendant's motion to dismiss the case. The circuit court dismissed the case with prejudice, reasoning in part that a dismissal without prejudice would not provide any meaningful remedy to the defendant. The court of appeals affirmed the circuit court's dismissal order, concluding that the circuit court had the discretion to dismiss the criminal case with or without prejudice under Wis. Stat. § 971.11(7). The court of appeals also ruled that the circuit court properly exercised its discretion in the present case.

II
¶ 11. We first consider what kind of dismissal of a criminal case is authorized under Wis. Stat. § 971.11: dismissal with prejudice or dismissal without prejudice? Section 971.11(2) provides that a district attorney shall bring a criminal case on for trial within 120 days after receipt of an accused's request for a prompt disposition of the criminal case "subject to s. 971.10." Section 971.11(7) provides that if a criminal case is not brought on for trial within the 120-day time period set forth in § 971.11(2), "the case shall be dismissed." Section 971.11(1), (2), and (7) states in relevant part as follows:
(1) Whenever the warden or superintendent receives notice of an untried criminal case pending in this state against an inmate of a state prison, the warden or superintendent shall, at the request of the inmate, send *997 by certified mail a written request to the district attorney for prompt disposition of the case. The request shall state the sentence then being served, the date of parole eligibility, if applicable, or the date of release to extended supervision, the approximate discharge or conditional release date, and prior decision relating to parole. If there has been no preliminary examination on the pending case, the request shall state whether the inmate waives such examination, and, if so, shall be accompanied by a written waiver signed by the inmate.
(2) If the crime charged is a felony, the district attorney shall either move to dismiss the pending case or arrange a date for preliminary examination as soon as convenient and notify the warden or superintendent of the prison thereof, unless such examination has already been held or has been waived. After the preliminary examination or upon waiver thereof, the district attorney shall file an information, unless it has already been filed, and mail a copy thereof to the warden or superintendent for service on the inmate. The district attorney shall bring the case on for trial within 120 days after receipt of the request subject to s. 971.10.

. . . .
(7) If the district attorney moves to dismiss any pending case or if it is not brought on for trial within the time specified in sub. (2) or (3) the case shall be dismissed unless the defendant has escaped or otherwise prevented the trial, in which case the request for disposition of the case shall be deemed withdrawn and of no further legal effect. Nothing in this section prevents a trial after the period specified in sub. (2) or (3) if a trial commenced within such period terminates in a mistrial or a new trial is granted. (Emphasis added.)
¶ 12. The text of Wis. Stat. § 971.11(7) is inconclusive about the legislature's intent regarding dismissal of a criminal case with or without prejudice. The *998 language in § 971.11(7) that "the case shall be dismissed" is silent on the issue of dismissal with or without prejudice when the State fails to bring the criminal case on for trial within the 120-day time period set forth in § 971.11(2). Although the legislature was aware of this issue, it failed to provide direction. As the court of appeals explains, the legislature had the opportunity to make its intent perfectly clear but apparently declined to do so.[5] In the absence of explicit direction in the text of the statute or legislative history, we must nevertheless determine whether the legislature intended a circuit court to dismiss the criminal case under § 971.11(7) with or without prejudice.
[2-4]
¶ 13. The aim of statutory interpretation is to discern the intent of the legislature. The court must ascertain the legislature's intent from the language of the statute in relation to its context, scope, history, and objective intended to be accomplished.[6] A cardinal rule in interpreting statutes is to favor an interpretation that will fulfill the purpose of the statute over an interpretation that defeats the manifest objective of the act.[7]
[5]
¶ 14. We agree with the court of appeals that "the legislature has left the matter up to the courts to exercise its [sic] discretion to dismiss with prejudice in a proper case lest the statute have no meaning at all."[8]*999 This interpretation of Wis. Stat. § 971.11(7) granting a circuit court the discretion to dismiss a criminal case with or without prejudice best serves the legislative purposes: First, this interpretation comports with the legislature's goal to prevent "the potential injustices resulting from the practice of filing detainers."[9] Second, it comports with the legislature's objective to give an inmate "a greater degree of knowledge about his [or her] future [so that he or she] could begin more constructive planning and co-operate on a treatment program with the knowledge his [or her] efforts would not be minimized by the threat of unsatisfied charges."[10] Third, it comports with the "legislative intent to provide the operation of a speedier disposition for inmates than for others charged with crimes."[11] Fourth, it comports with the legislative purpose to prevent the State from repeatedly dismissing and refiling a criminal case after a dismissal without prejudice, rendering the 120-day time period set forth in § 971.11(2) a nullity. "The proper control of continued refiling of charges by the State is the authority of the courts to dismiss with prejudice."[12] We further agree with the court of appeals that to interpret § 971.11(7) as requiring dismissal of a criminal case only without prejudice would deprive an inmate of prompt disposition of the case, which is the very purpose of § 971.11.
*1000 [6]
¶ 15. The court of appeals' interpretation of Wis. Stat. § 971.11(7) is also consistent with the statutory direction in § 971.11(2) that a criminal case against an accused shall be brought on for trial within the 120-day time period "subject to Wis. Stat. § 971.10," the "speedy trial" statute. Under section 971.10(3), a circuit court may in its discretion grant a continuance under the "speedy trial" provisions of § 971.10.[13] However, the *1001 circuit court must set forth in the record its reasons for finding that the ends of justice served by granting a continuance outweigh the best interests of the public and the accused in a speedy trial.
¶ 16. Because Wis. Stat. § 971.11(2) states that it is subject to § 971.10, we must read §§ 971.10 and 971.11 together. Under Wis. Stat. § 971.10(4), if the State fails to meet the statutory speedy trial time periods and has not been granted a continuance, the accused is discharged from custody to the detriment of the State and to the benefit of the accused. On the other hand, an accused cannot be discharged from custody as a consequence of the State's failure to bring a criminal case on for trial in the context of § 971.11, because the accused subject to § 971.11 is incarcerated for committing another crime. However, the concept that failing to meet a statutory time period imposes a disadvantage on the State and grants a benefit to an accused applies equally to both §§ 971.11 and 971.10.
[7]
¶ 17. The detriment/benefit objective can be achieved in Wis. Stat. § 971.11(7) by allowing a circuit court to dismiss a criminal case with prejudice when no good cause is shown for the State's failure to comply with the 120-day time period and to dismiss a criminal case without prejudice when good cause is shown for doing so.
[8]
¶ 18. A dismissal of a criminal case with prejudice under Wis. Stat. § 971.11(7) penalizes the State, but gives an accused the benefit of the prompt disposition statute and is thus in the public interest.
*1002 [9]
¶ 19. However, a dismissal of a criminal case without prejudice under Wis. Stat. § 971.11(7) also penalizes the State by forcing the State to begin the case again and repeat various proceedings, such as the preliminary hearing. On the other hand, an accused may or may not benefit from a dismissal of a criminal case without prejudice. Nonetheless, the objectives set forth in § 971.11 are furthered, and thus the public interest is protected.
¶ 20. The court of appeals' interpretation of Wis. Stat. § 971.11(7) giving a circuit court the discretion to dismiss a criminal case with or without prejudice comports with the principles set forth in §§ 971.10 and 971.11.
¶ 21. The State makes three arguments in its attempt to persuade this court that the court of appeals has erred in its interpretation of Wis. Stat. § 971.11:
[10]
¶ 22. First, the State relies on State v. Braunsdorf, 98 Wis. 2d 569, 297 N.W.2d 808 (1980), in arguing that Wis. Stat. § 971.11(7) requires dismissal of a criminal case without prejudice. We agree with the court of appeals that the State's reliance on Braunsdorf is misplaced. In Braunsdorf there was no statute that authorized or required the dismissal of a criminal case. The Braunsdorf court held that in the absence of a statute, the "power to dismiss a criminal case with prejudice prior to jeopardy on nonconstitutional grounds is not ... an inherent power of the trial courts of this state."[14] Because Braunsdorf addressed only a *1003 circuit court's inherent power to dismiss criminal cases, we conclude that it cannot be interpreted, as the State urges, to mean that a circuit court's authority to dismiss a criminal case is limited to a dismissal of the case without prejudice unless a statute explicitly authorizes a dismissal with prejudice.
¶ 23. Second, the State argues that Wis. Stat. § 971.11, the Intrastate Detainer Act, should be read along with § 976.05(3)(d), (4)(e), and (5)(c), the Interstate Detainer Act, which explicitly provides for dismissal of a criminal case "with prejudice."[15] The State argues that the phrase "shall be dismissed" in the intrastate detainer statute means dismissal without prejudice rather than dismissal with prejudice. Were it otherwise, the State argues, two different phrases, "shall be dismissed" and dismissed "with prejudice," in these two related statutes would be given the same meaning, and the words "with prejudice" in the interstate detainer statute would be superfluous.
[11]
¶ 24. We are not convinced by the State's reasoning. The phrase "with prejudice" in the Interstate Detainer Act was clearly intended to ensure that dismissals under that act were with prejudice. The phrase "with prejudice" will not be superfluous regardless of how the phrase "shall be dismissed" in Wis. Stat. § 971.11(7) is interpreted. Neither the language *1004 nor the history of the two statutes makes it clear, as the State contends, that the legislature intended a dismissal of a criminal case under the two statutes to result in different outcomes.
¶ 25. Third, the State argues that interpreting Wis. Stat. § 971.11(7) to grant circuit courts the discretion to dismiss a criminal case with or without prejudice intrudes into the realm of prosecutorial discretion. The State asserts that under § 971.11(7) a circuit court shall dismiss a criminal case in two circumstances: (1) if the district attorney moves to dismiss the case; or (2) if the case is not brought on for trial within the time specified in subsections (2) or (3). The phrase "shall be dismissed" applies to both situations and must be interpreted in the same way for both situations.
[12]
¶ 26. The State argues that the legislature did not intend to limit a district attorney's discretion to dismiss a criminal case by allowing a circuit court to dismiss the criminal case with prejudice upon the district attorney's motion to dismiss. We disagree with the State. Although prosecutors have broad discretion in criminal matters, that discretion is not without limits. We conclude that the legislature achieved its objective in Wis. Stat. § 971.11(7) of prompt disposition of certain cases by increasing the circuit court's power over a prosecutor's power to dismiss a criminal case.
[13]
¶ 27. Because the defendant in the present case properly requested a prompt disposition of his criminal case pursuant to Wis. Stat. § 971.11, we conclude that the State's failure to bring the case on for trial within the 120-day time period set forth in § 971.11(2) permits *1005 the circuit court under § 971.11(7) to exercise its discretion to dismiss the criminal case with or without prejudice.

III
[14-16]
¶ 28. We must now determine whether the circuit court properly exercised its discretion in dismissing the criminal case against the defendant with prejudice. A reviewing court will affirm a discretionary decision by a circuit court so long as the circuit court did not erroneously exercise its discretion.[16] An erroneous exercise of discretion results when the exercise of discretion is based on an error of law.[17] An erroneous exercise of discretion occurs when the circuit court does not consider the facts of record under the relevant law or does not reason its way to a rational conclusion.[18]
[17]
¶ 29. In exercising its discretion to dismiss a criminal case with or without prejudice for the State's failure to bring the case on for trial within the time period set forth in Wis. Stat. § 971.11(7), a circuit court should consider a number of factors, including, but not limited to, the following: the reasons for and the length of the delay in bringing the criminal case on for trial; whether the nature of the case makes it unreasonable to expect adequate preparation within the statutory time period; an accused's conduct contributing to the delay; an accused's waiver of the statutory right to *1006 prompt disposition;[19] the harm to an accused resulting from the delay, such as anxiety and concern; the effect of the delay on an accused's legal defenses; the effect of the delay on the programs and movement within the institutions available to an accused; the effect of the delay on the orderly rehabilitation process of an accused within the Department of Corrections; the effect of the delay on an accused's concurrent sentencing possibilities; the effect of the delay on an accused's possible transfer to a less secure facility; the effect of the delay on an accused's opportunity for parole; the effect of the delay on the transfer of the accused to another institution; the effect of the delay and dismissal on the public interest in the prompt prosecution of crime; and the effect of the delay and dismissal on the victim. By balancing these and other factors, the circuit court will not necessarily produce the same result in every case.
¶ 30. The circuit court in the present case reasoned that dismissal of the criminal case against the defendant with prejudice was necessary as a matter of law under Wis. Stat. § 971.11 because dismissal without prejudice would leave no remedy for any inmate to enforce the statutory right of prompt disposition under § 971.11. The circuit court stated in relevant part:
I find as a matter of law that any time charges are filed against someone in a correctional institution and they *1007 file a ... prompt disposition request, that 971.11 should be complied with to the letter.... I also find as a matter of law that ... dismissal without prejudice in this Court's view would leave absolutely no teeth in the statute whatsoever. As far as I'm concerned, it would mean that the inmate has a remedy without any enforcement power.
¶ 31. The circuit court also recognized the special interest shared by inmates and society in the speedy disposition of pending criminal charges. Rehabilitation is hampered, stated the circuit court, by keeping inmates in security classifications that because of pending charges may not be appropriate. The circuit court stated: "I'm assuming we are all interested in rehabilitating our inmates. We can't rehabilitate our inmates by keeping them in security classifications simply because there are charges pending elsewhere."
¶ 32. The circuit court further reasoned that all of the persons charged with carrying out the requirements of Wis. Stat. § 971.11 in the present case failed except for the defendant, who properly sought the prompt disposition of the criminal case against him. The circuit court stated:
I don't think all of the requirements of the statute have been complied with by the people who are required to comply with it.
If the Court has some sort of obligation here, the Court didn't comply with it. The district attorney didn't comply with it. The warden didn't comply with it. The sheriff didn't comply with it. The only person as far as I can tell that complied with any portion of the statute is [the defendant] himself.
*1008 [18]
¶ 33. The circuit court appears to have decided that Wis. Stat. § 971.11(7) requires dismissal of a criminal case with prejudice as a matter of law. The circuit court seems to have further concluded that unless the present case was dismissed with prejudice, an accused would have no remedy to enforce the statutory right to prompt disposition. The circuit court's rationale and the application of the rationale to the facts in the present case come close to requiring dismissal with prejudice in every criminal case when a district attorney fails to bring a case on for trial within the 120-day time period set forth in § 971.11(2). We therefore conclude, in contrast to the court of appeals, that the circuit court did not properly exercise its discretion to consider dismissal without prejudice before dismissing the criminal case against the defendant with prejudice.
¶ 34. In summary, we conclude, as did the court of appeals, that Wis. Stat. § 971.11(7) grants a circuit court the discretion to dismiss a criminal case with or without prejudice if the case has not been brought on for trial within the 120-day time period set forth in § 971.11(2). We further conclude that the circuit court did not properly exercise its discretion in the present case, and accordingly, we remand the cause to the circuit court to exercise its discretion consistent with this court's interpretation of § 971.11(7).
By the Court.  The decision of the court of appeals is reversed and the cause is remanded to the circuit court.
NOTES
[1]  All subsequent references to the Wisconsin Statutes are to the 1999-2000 version unless otherwise indicated.
[2]  This case does not involve any constitutional issues and the dismissal is prior to the attachment of jeopardy.
[3]  This statute has also been referred to as Wisconsin's Disposition of Intrastate Detainer Act under a previous codification. State v. Fogle, 25 Wis. 2d 257, 260, 130 N.W.2d 871 (1964).
[4]  According to the stamp of the Dodge County Clerk of Courts, the request for prompt disposition was filed on April 12, 1999.
[5]  State v. Davis, 2001 WI App 63, ¶¶ 11 and 12, 242 Wis. 2d 344, 626 N.W.2d 5.
[6]  Dixon v. Dixon, 107 Wis. 2d 492, 498-99, 319 N.W.2d 846 (1982).
[7]  Dixon, 107 Wis. 2d at 498-99.
[8]  Davis, 2001 WI App 63 at ¶ 15.
[9]  State ex rel. Fredenberg v. Byrne, 20 Wis. 2d 504, 511, 123 N.W.2d 305 (1963).
[10]  Davis, 2001 WI App 63 at ¶ 14 (quoting letter from Director of Public Welfare to the members of the State Board of Public Welfare recommending prompt passage of the Intrastate Detainer Act).
[11]  State v. Adams, 207 Wis. 2d 568, 575, 558 N.W.2d 923 (Ct. App. 1996).
[12]  Davis, 2001 WI App 63 at ¶ 15.
[13]  Wisconsin Stat. § 971.10(2)(a) and (3) provides in relevant part as follows:

(2)(a) The trial of a defendant charged with a felony shall commence within 90 days from the date trial is demanded by any party in writing or on the record . . . .
(3)(a) A court may grant a continuance in a case, upon its own motion or the motion of any party, if the ends of justice served by taking action outweigh the best interest of the public and the defendant in a speedy trial. A continuance shall not be granted under this paragraph unless the court sets forth, in the record of the case, either orally or in writing, its reasons for finding that the ends of justice served by the granting of the continuance outweigh the best interests of the public and the defendant in a speedy trial.
(b) The factors, among others, which the court shall consider in determining whether to grant a continuance under par. (a) are:
1. Whether the failure to grant the continuance in the proceeding would be likely to make a continuation of the proceeding impossible or result in a miscarriage of justice.
2. Whether the case taken as a whole is so unusual and so complex, due to the number of defendants or the nature of the case or otherwise, that it is unreasonable to expect adequate preparation within the periods of time established by this section.
3. The interests of the victim, as defined in s. 950.02(4).
(c) No continuance under par. (a) may be granted because of general congestion of the court's calendar or the lack of diligent preparation or the failure to obtain available witnesses on the part of the state.
[14]  State v. Braunsdorf, 98 Wis. 2d 569, 585, 297 N.W.2d 808 (1980). The court reaffirmed Braunsdorf in State v. Krueger, 224 Wis. 2d 59, 61, 588 N.W.2d 921 (1999).
[15]  Wisconsin statutes vary as to whether they merely state that a cause be dismissed (see, e.g., Wis. Stat. §§ 961.47(1), 968.02(2), 970.03(10), 971.09(5), 971.11(7), 973.11(4), 980.04(3), and 980.05(5)); that a cause be dismissed without prejudice (see, e.g., Wis. Stat. §§ 968.03(3), 971.01(2), and 971.14(1)(c)); and that a cause be dismissed with prejudice (see, e.g., Wis. Stat. §§ 971.37(3), 971.39(1)(f), 976.05(3)(d), 976.05(4)(e), and 976.05(5)(c)).
[16]  Hull v. State Farm Mut. Auto Ins. Co., 222 Wis. 2d 627, 635-6, 586 N.W.2d 863 (1998).
[17]  Hull, 222 Wis. 2d at 636.
[18]  Burkes v. Hales, 165 Wis. 2d 585, 590-91, 478 N.W.2d 37 (Ct. App. 1991).
[19]  The court of appeals noted that the State did not raise the issue of the defendant's waiver of his statutory right to prompt disposition in the circuit court and, therefore, the court of appeals would not consider the argument. The court of appeals also concluded that the record is insufficient to evaluate whether any of the defendant's or defense counsel's actions could be construed as a waiver. Davis, 2001 WI App 63 at ¶ 5 n.3.
