A Washington man will go to prison for supplying the heroin that killed a woman two summers ago.

James Brekke, 24, pleaded guilty Thursday rather than go to trial June 4 on a Class X charge of drug-induced homicide, punishable by up to 30 years in prison.

In exchange, prosecutors agreed to a six-to-18-year range on his sentence, of which he’ll serve at least 75 percent. In custody since he was charged in November 2016, he’ll be sentenced July 24.

Brekke acknowledged at his arrest that he supplied heroin for Carrie Maynard, 37, the day before she was found dead on Sept. 6, 2016, along the Wood Street bicycle trail near her home in Washington, a prosecutor’s court affidavit stated.

Maynard and another woman drove with Brekke to a home in Peoria where Brekke purchased heroin, the affidavit stated. An hour after she returned, her boyfriend with whom she lived saw her apparently under the drug’s influence.

Maynard left the house and was found deceased the next day, the affidavit stated.

Text messages on Maynard’s cellphone, found in her purse next to her body, included recent contacts with Brekke of a nature “consistent with drug transactions,” the affidavit stated.

Brekke remains the only person charged in the case.