The South Florida teenager who was sentenced to 30 days in prison after reportedly flipping off a judge and saying “f*ck you” has apologized for her ratchet behavior, and as a result, was released from prison.

Earlier this week, a viral video showing 18-year-old Penelope Soto flipping the bird at Miami-Dade Circuit Judge Jorge Rodriguez-Chomat during a court hearing last Monday (Feb 4).

WATCH: Teen Flips Off Judge, Says “F*ck You” and Gets 30-Day Jail Sentence

Throughout the entire hearing, Soto — appearing on a Xanax possession charge — maintained a snarky attitude and was seen giggling and making jokes, and after having enough, the judge raised her $5,000 bond to $10,000. After verifying that he was serious, and he was most certainly serious, she flipped him off and said “fuck you.”

Not surprisingly, Judge Rodriguez-Chomat charged Soto with contempt of court and sentenced her to 30 days in jail. But on Friday (Feb 9), Soto appeared at a second hearing with a brand new attitude, and apologized to Rodriguez-Chomat for insulting him.

“I normally don’t act like that … My behavior was very irrational, and I apologize not only to the court and you, but to my family,” Penelope Soto told Rodriguez-Chomat, as her lawyer and relatives stood next to her.

In response to her “heartfelt” apology, which probably came at the advice of her family and/or lawyer, the judge decided to drop the 30-day contempt sentence. Judge Rodriguez-Chomat also did away with the $10,000 bond he had set, which allowed Soto to be released from jail straight from the courtroom.

Among the reasons he cited for dropping her contempt sentence and the $10K bond were her being a first-time offender, her admitting to abusing Xanax, and her willingness to overcome her addiction by going to rehab, as well as her apology.

Soto’s lawyer also publicly apologized on her client’s behalf, and offered the excuse that Soto had been “impaired” by drugs and alcohol before she acted out in court Monday. “That impairment, even though I don’t condone her actions, led her to the conduct that was contemptuous before you,” the attorney said.

The judge agreed that while the teen did make some terrible choices, she wasn’t entirely to blame for her behavior, though he does hope she has learned her lesson.

“I should not even call you as totally responsible. We live in a society where if you listen to music, every other word is a profanity,” Rodriguez-Chomat said. “We live in a society where young people like you feel like it’s perfectly OK to call all kinds of names to their teachers and their professors and their friends. And they think that’s OK.”

Rodriguez-Chomat continued, “We live in a society where police officers are abused on a daily basis, mostly by young people who believe it’s OK to call policemen all kinds of names. That’s totally unacceptable.”

He added, “Lesson No. 1 is that drugs can put you in a very difficult situation. It is because of your use of Xanax — which I understand is a party drug — can put you, convert you, make you a felon, a convicted felon. It can put you in a county jail like you have been.”

“Good luck to you, Miss Soto,” the judge concluded. “I really do hope that you learned your lesson.”

[NBC News / Mugshot: KSEE24]

Be the first to receive breaking news alerts and more stories like this by subscribing to our mailing list.