MIAMI (WTVJ) -- What began as a young South Florida woman's defiant profanity and waving of the middle finger to a judge earlier this week turned into an etiquette lesson Friday - when the tearful woman publicly apologized for her behavior.

But Friday, 18-year-old Soto was solemn as she acknowledged to Rodriguez-Chomat that she was wrong for insulting him. Her lawyer and relatives stood next to her as she apologized.

"My behavior was very irrational, and I apologize not only to the court and you, but to my family," Penelope Soto told Rodriguez-Chomat.

Responding to her apology, Rodriguez-Chomat dropped the 30-day contempt sentence he had imposed on her when she first appeared before him on a Xanax possession charge. Among the reasons he cited for dropping her contempt sentence were her being a first-time offender, her admission that she had abused Xanax, her willingness to overcome her addiction by attending a drug-treatment program and her apology.

Rodriguez-Chomat said Soto wasn't entirely to blame for her behavior.

"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."

Rodriguez-Chomat also did away with the $10,000 bond he had set, enabling Soto to be released from jail straight from the courtroom.

Soto's lawyer also publicly apologized on her client's behalf and said Soto was impaired by her ingestion of 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," Soto's lawyer said.

Soto's legal case began Sunday, when authorities arrested her after she allegedly told them she was "on Xanax bars" and three green baggies filled with Xanax were found in her purse, an arrest affidavit said.

At Monday's hearing, Soto smiled and stroked her hair, and laughed when Rodriguez-Chomat asked her about her jewelry and other assets for the purposes of setting her bond amount.

"It's not a joke, you know. We're not in a club now," Rodriguez-Chomat told her at the time. "We are not in a club. Be serious about it."

"I'm serious about it. You just made me laugh," Soto replied. "You just made me laugh. I apologize. It's worth a lot of money."

Rodriguez-Chomat had initially set her bond at $5,000 and said "bye-bye," and Soto laughed and replied "Adios." Rodriguez-Chomat summoned her back and raised her bond to $10,000, shocking Soto.

"Are you serious?" she asked.

"I am serious. Adios."

Soto started to walk away when she flipped Rodriguez-Chomat the middle finger and blurted "[expletive] you."

She was called back again, and Rodriguez-Chomat handed down the 30-day contempt sentence.

At Friday's hearing, Soto paused as she apologized because she began to tear up.

"Don't cry," the judge told her.

With tears, Soto smiled briefly at the judge.

"Oh, I made you laugh, but it's all right," he said. He asked her to keep going with her apology. "Go ahead, tell me," he said.

She said, "I normally don't act like that," then she sighed.

The judge asked whether she took any Xanax the day she was arrested. She said, "Yes, I did. Two."

The judge told Soto he hoped she had learned several lessons since Monday.

"Lesson No. 1 is that drugs can put you in a very difficult situation," he said. "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."