This teenager, Penelope Soto, was sentenced to 30 days in jail for swearing at a judge.

The teen who flipped off a judge has apologized on Friday, and in doing so avoided spending a month in jail, according to CBS Miami.

Teenager, Penelope Soto, was given a 30 day jail sentence earlier this week for disrespecting Judge Jorge Rodriguez-Chomat on Monday.

However, Soto came before the same judge on Friday to offer a tearful apology, and to admit that she had been under the influence of drugs and alcohol during her first hearing on Monday.

Judge Jorge Rodriguez-Chomat accepted her sincere apology and dropped the contempt of court charges, freeing her from her 30 day jail term.

However, she will now have to complete a court drug program.

Here is a video recording of Penelope Soto coming before the judge on Friday, offering a tearful apology, and avoiding jail time:

Earlier in the week, Soto giggled, rolled her eyes at the judge, and played with her hair, throughout her hearing after she was arrested on charges of possession of Xanax - the same drug she now admits to being under the influence of during her original hearing.

At the first hearing on Monday, the judge originally set Soto's bond at $5,000, and as she was dismissed she laughed and loudly proclaimed, "Adios," to the judge. The judge, not impressed, called her back to face him, and he upped her bond to $10,000. Not realizing she was playing with fire, Soto snapped and shouted out at the judge, "Are you serious?"

She then flipped up her middle finger at the judge while saying that he could "Go **** himself!"

Judge Jorge Rodriguez-Chomat was not impressed, and knew exactly what to do to show the teenager who was in charge and to teach her to pay greater respect next time in court. He immediately sentenced her to 30 days in jail.

Video footage caught the incident, which has now gone viral, with many people applauding the judge to his strict tone with the disrespectful teenager.

One blogger wrote, "Well done sir for being strict with this horrid girl. Such disrespect. Go exactly what she deserved. Maybe that will teach her to have some manners."

Here is a video of the original incident taking place in Miami:

However, it now appears as though Soto will avoid her jail term, and her attorney has since said that she will complete a court drug program, which includes treatment for drug addiction. If she completes the program successfully there is a possibility of her charges eventually being dropped as she is a first-time offender.