*647OPINION
Appellant Andrew Tyler Jones was unable to post bail and spent 286 days in the Olmsted County jail awaiting resolution of the charges against him and sentencing. Under Minn.Stat. § 641.12, subd. 3(a) (2008), the county required Jones to pay for his preconviction confinement costs. Jones brought suit challenging the county’s decision to require him to pay precon-viction confinement costs. The district court granted the county’s motion for summary judgment, and the court of appeals affirmed. We reverse.
On March 31, 2004, Jones was arrested and charged in Olmsted County with three counts of aggravated robbery. Jones was held in the Olmsted County jail, awaiting resolution of the charges against him and sentencing. Jones was not able to post bail because he was indigent. On November 22, 2004, Jones pleaded guilty to all charges. On January 3, 2005, the district court sentenced him to 78 months in prison. On January 10, 2005, the Department of Corrections transferred Jones from the jail to a correctional facility in St. Cloud. Overall, Jones spent 286 days in the Olmsted County jail. Under Minn.Stat. § 641.12, subd. 3(a), the county sent a bill to Jones seeking payment of $25 for each day he was confined, totaling $7,150. In August 2005, Jones received a final collection notice from the Olmsted County Sheriffs finance office. Still indigent and now imprisoned, he could not afford to pay the bill.
Jones brought suit and alleged that the county erroneously required him to pay for preconviction confinement costs under Minn.Stat. § 641.12, subd. 3(a).1 Minnesota Statutes § 641.12, subd. 3(a), states that “[a] county board may require that an offender convicted of a crime and confined in the county jail, workhouse, or correctional or work farm pay the cost of the offender’s room, board, clothing, medical, dental, and other correctional services.”
Both parties moved for summary judgment with both parties seeking an interpretation of the statute. The district court granted summary judgment in favor of the county, applying the statute to Jones’s pre-conviction confinement and upholding the statute’s constitutionality.
The court of appeals affirmed. Jones v. Borchardt, 759 N.W.2d 50, 57 (Minn.App.2009). First, the court held that subdivision 3(a) is ambiguous but that, when read in the context of surrounding subdivisions, it allowed the county to require Jones to pay for his preconviction confinement costs. Id. at 54. Second, the court held that subdivision 3(b) permitted but did not require the county to consider Jones’s indigence in determining whether to waive payment. Id. at 55. Last, the court concluded that the statute’s application to Jones violated neither equal protection nor due process rights. Id. at 56.
Statutory construction is a question of law that courts review de novo. D.M.S. v. Barber, 645 N.W.2d 383, 386 (Minn.2002). The object of all statutory interpretation is to ascertain and effectuate legislative intent. Minn.Stat. § 645.16 (2008). When interpreting a statute, a court construes words and phrases according to the rules of grammar and their common and approved usage. MinmStat. § 645.08(1) *648(2008). If a law’s words are clear and unambiguous, a court cannot disregard its meaning under the pretext of following the spirit of the law. Minn.Stat. § 645.16.
In their arguments to this court, Jones and the county focus on the meaning of the phrase “offender convicted of a crime and confined in the county jail” found in the first part of Minn.Stat. § 641.12, subd. 3(a). They each contend that this phrase determines the period of confinement for which counties may require persons to pay related costs, but argue different interpretations. Jones argues the phrase conveys that a county may only require payment from persons convicted of a crime and then confined in a county jail. Under Jones’s interpretation, subdivision 3(a) permits requiring persons to pay only for the costs of confinement resulting from conviction, limiting the statute’s reach to postconviction costs. The county asserts the phrase simply requires that persons meet two conditions — conviction and confinement — before a county may require payment of them. According to the county, the subdivision permits counties to require payment for postcon-viction and, retroactively, preconviction confinement costs.
We do not agree that the phrase “convicted of a crime and confined in the county jail” defines the period of confinement for which counties may require persons to pay their confinement costs. Instead, we believe the operative language appears in the second part of subdivision 3(a), which addresses for what counties may require payment. The second part of subdivision 3(a) states that counties may require payment for “the cost of the offender’s room, board, clothing, medical, dental, and other correctional services.” MinmStat. § 641.12, subd. 3(a) (emphasis added). Because offender's modifies the expenses listed, the statute permits a county to require payment only for an offender’s expenses. Stated differently, the statute does not authorize counties to require payment for a nonoffender’s expenses.
An “offender” is “[a] person who has committed a crime.” Black’s Law Dictionary 1110 (9th ed. 2009). The state deems a person to have committed a crime upon conviction. Under Minnesota law, “conviction” occurs when the court accepts and records a guilty plea. See Minn.Stat. § 609.02, subd. 5(1) (2008). Upon his conviction, and not before, Jones became an “offender” under Minn.Stat. § 641.12, subd. 3(a). Jones’s preconviction confinement costs were not an “offender’s” expenses because Jones was a nonoffender when he incurred them. The phrasing and words of the subdivision are unambiguous; we cannot disregard them to search for alternative legislative intent.2
We hold that a county may require persons to pay the costs of their confinement under Minn.Stat. § 641.12, subd. 3(a), but only the costs of confinement incurred after conviction. Because the county required Jones to pay for costs incurred before conviction, the county erred in its application of subdivision 3(a).
Reversed and remanded to the district court for further proceedings consistent with this opinion.