NEW YORK (AP) - Grammy-winning rapper Cardi B resolved a yearslong criminal case stemming from a pair of brawls at New York City strip clubs by pleading guilty Thursday in a deal that requires her to perform 15 days of community service.

The 29-year-old “WAP” singer agreed to a conditional discharge just as her case was about to go to trial, saying in a statement: “Part of growing up and maturing is being accountable for your actions.”

Cardi B, a New York City native whose real name is Belcalis Almanzar, pleaded guilty to two misdemeanor charges stemming from the August 2018 fights. Ten other counts, including two felonies, were dismissed. Two co-defendants also pleaded guilty.

According to prosecutors, Cardi B and her entourage were targeting employees of Angels Strip Club in Flushing, Queens, over an apparent personal dispute.

In one fight, chairs, bottles and hookah pipes were thrown as the group argued with a bartender. She and another employee had minor injuries.

“No one is above the law,” Queens District Attorney Melinda Katz said in a statement. “In pleading guilty today, Ms. Belcalis Almanzar and two co-defendants have accepted responsibility for their actions. This Office is satisfied with the resolution, which includes appropriate community service.”

In 2019, Cardi B rejected a plea deal that would have given her a conditional discharge. Prosecutors then presented the case to a grand jury and obtained an indictment that included the two felony charges.

“I've made some bad decisions in my past that I am not afraid to face and own up to,” said Cardi B, adding that she wanted to set a good example for her two children.

“These moments don't define me and they are not reflective of who I am now,” she added. “I'm looking forward to moving past this situation with my family and friends and getting back to the things I love the most-the music and my fans.”

Cardi B's chart-topping hits include “I Like It” and the Maroon 5 collaboration “Girls Like You.”