Azealia Banks faces a judge (Friday, March 10, 2017)

Azealia Banks arrives for a pretrial conference for her misdemeanor assault and attempted assault case in New York (Friday, March 10, 2017)

*Just as Azealia Banks was about to begin her trial Wednesday (March 15) for biting a woman’s breast, the rapper agreed to a plea deal to avoid any threat of jail time, reports Page Six.

Banks, 25, copped to third-degree assault, the top count against her, in exchange for a deferred no-jail sentence for a the altercation at Up & Down nightclub in December 2015. The rapper allegedly cursed out a female bouncer who didn’t recognize her, then punched and bit her boob when the bouncer threw her off the premises.

“Did you intentionally cause physical injury to Christine Soares by biting down on her breast?” asked Judge Ann Scherzer in Manhattan Criminal Court.

“Yes,” answered Banks, wearing a skin-tight minidress, sparkly tights and platform boots that made it difficult for her to walk, according to Page Six.

Banks must now complete an anger management program, continue mental health treatment, abide by a full order of protection and avoid any more brushes with the law.

If those conditions are met, the assault conviction will be reduced to disorderly conduct — a violation, not a crime. Scherzer warned her that if she violated the terms, she faced up to a year in jail.

Banks took the deal a few days after Assistant District Attorney Shea Donato said in a pretrial hearing last Friday that she wanted to introduce some of Banks’ past bad behavior, including slashing her sister in the neck, arm and hand in 2008, and the Russell Crowe incident from October 2016.

The string of controversy appears to have hit her bank account hard, as Banks was forced to ditch her private lawyer in exchange for a free court-appointed counselor during the case, Page Six reported.

Banks was supposed to be the sole defense witness at her trial.

Below, the rapper arrives in court for a pre-trial hearing on March 10: