The Teen Mom star was arrested and thrown in jail December 19 for allegedly violating her probation. Portwood remained behind bars until Friday, when she struck a deal requiring her to plead guilty to possession of a controlled substance and violating her probation.

As part of the deal, TMZ reports the 21-year-old must also complete a court-ordered drug rehabilitation program. The case will be dismissed provided Portwood complies with the terms of the plea deal. Should the MTV star violate any of these conditions, she will immediately be sent to prison to begin serving a five-year sentence.