NEW YORK (CBSNewYork/AP) — The bong-toss case against Amanda Bynes will be dismissed if she stays out of trouble for six months and goes to counseling.

A Manhattan judge on Friday allowed the adjournment in contemplation of dismissal, which means the troubled 27-year-old actress does not have to admit guilt. She must attend counseling twice a week for six months.

The “Hairspray” actress didn’t appear in court. An affidavit filed on her behalf by attorney Gerald Shargel said she understood the agreement.

Bynes was charged last May with reckless endangerment and marijuana possession after building managers called police because they said she was smoking pot in the lobby of her Manhattan apartment. When officers entered her 36th-floor apartment, they said they saw her heave a bong out the window.

According to prosecutors, no bong was recovered and the actress’ attorney said that was a sign that his client was telling the truth.

In a statement, Bynes later called the charges against her “lies” and claimed that it all started when one of the responding officers sexually harassed her the night before. Internal Affairs was reviewing that claim.

Days after her arrest, she posted a lengthy note on Twitter announcing that she’s suing the NYPD.

In July, Bynes was placed in psychiatric care after deputies said she started a small fire in the driveway of a home in Southern California.

Her family’s attorney told People magazine last month the actress had completed rehab and was recovering at her parent’s home.

The actress rose to fame a decade ago as a major star on Nickelodeon. She has since shed her wholesome image. Weeks prior to her arrest, the former Nickelodeon star garnered national attention for posting odd videos and racy pictures on Twitter.

You May Also Be Interested In These Stories:

(TM and © Copyright 2014 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2014 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)

Watch & Listen LIVE