AITA for cutting off one of my closest best friends of three years because she got everyone to hate me?

I (in my teens - F) have a friend who I have gotten very close with over the past three years who we'll call Sarah. Sarah had minor red flags here and there (she wouldn't finish homework on time, struggled with time management, lied a lot to win games, and was obsessed with drama and made mean comments about others.) I was pretty blind to these, and would normally brush it off.

Everything was going fine, until a few months back. Sarah and another friend of mine had been getting closer, and sometimes both of them would stay after school for 30 minutes to chill and get work done- I never really joined them. One day the friend Sarah had been getting close to (let's call her Lilly) came up to me and told me that Sarah had been talking about me a lot recently when I wasn't around. I didn't really think much of it because Sarah had been probably the closest person around me at the time. But over time Sarah started to say really mean things to me and play it off as a joke. For example, she would tell the table "how ugly I am. Or how I don't look like I put effort into getting ready." I was really put off by that, and when I or anybody else would stand up for me, she'd say "I'm just kidding! Or No I'm sorry it was supposed to be a joke." It really bothered me since she wasn't doing it to anyone else, just me. I started to distance myself from her but it was almost impossible since everyone thought we were best friends, and constantly paired up and she didn't think she was doing anything wrong. Little did I know, this gossiping thing got a whole lot worse. Every time she didn't like something I did, or said she would go and talk shit about me to someone else. This got so bad to the point that a ton of people came up to me and told me what she was saying to them.

Just to show you how extreme this got, here is an example.

I became friends with a guy and our friendship was in no way romantic. We just enjoyed doing some of the same things and had band class and homeroom together. Everytime we would sit next to eachother and talk, she would run into us and try to separate us. Sometimes Sarah would even shove me to get me away from him, or push me into him. (She didn't have a crush on him). Me and him were apart of a special program at school, and had to have meetings with a teacher sometimes. It was near the beginning of the year, so we needed to sort things out in terms of when we will meet ect... We talked a lot during that period, and needed to go to meetings together often. (And information about this program was strictly confidential.) So one time me and him sat down to eat really quickly before we needed to speak with the teacher and figured we would eat first, then his friends saw us and asked if they could sit with us. He said yes and I obviously agreed, but my friends and Sarah saw us and they assumed I ditched them. I didn't notice they walked by and it wasn't my intention to come off like that. But while I was gone, Sarah used this as her opportunity to cultivate false rumors about me. She told everyone that me and him were in a secret relationship, and the meetings were just a cover for us to go make out, and she suggested that I was apart of a threesome with him and another one of his friends. This was completely untrue, and she told everyone she overheard us in band talking about it, and we were super close during the class. (The reason I would stick with him was because I wanted to avoid dealing with Sarah, since she was being really mean and I didn't know anybody else in Band). My friends shot down the idea, but she told them to go follow us and listen to our conversations to see she wasn't lying. My friends returned, but they had heard about the details of the program. Sarah, who knew about it proceeded to tell them every detail about not only my, but his information. I became close with his friends later on, and she would gossip and make up rumors about me and them. She told me once to my face that They were probably only friends with me because I fuck them and give them my body, which is absolutely disgusting since it was a group of 5 people. It makes me sick to think about all the people she told this to.

I decided to confront her about this, and asked her to please stop talking shit about me and spreading false rumors. Sarah completely denied this, and decided to play the victim. She went around telling everybody that I was being a bitch and I was mad for no reason. A couple weeks passed, and I had been ignoring her. She decided to apologise, and she didn't completely own up to it but I took it. I didn't really trust her but decided to forgive, since i didn't want any enemies. After all that you would think that she learned her lesson. SHE DID NOT. The next thing she goes and does is talk shit. At this point I am so mad after everything that happened, and I confront her.

Here is how it went.

Sarah: "What can I do to make you like me more?"

Me: "I would like you more if you didn't talk shit behind my back and be fake to my face."

Sarah:" What are you talking about? I didn't"

Me: "If you didn't just lie to me and said sorry, maybe I would forgive you, but the fact that you are lying right now and trying to gaslight me says something about you. I heard from multiple people that you have still been talking about me."

Sarah: " Give me names."

Me: "No."

Sarah: "If SOOO many ppl told you, why don't you give me a couple names?"

Me: "because they are my friends and I'm not gonna rat them out. I'm not a bitch like you."

Then she proceeded to tell everyone that (her exact words) "Shes mad at me and I have no idea why and it's really scary." What the fuck does she mean she had no idea?? I told her outright. Then she goes and tells everyone fake stories about me, and how im "bullying her" and now everyone thinks I'm a hoe and I'm bullying this poor girl.

I blocked her on everything and stopped talking to her.

But I can't help but wonder If I'm being the same as her by talking and whining about her being a bitch and what she did to me, and if I'm missing something here. She was genuinely a real one, and a really supportive friend. She would have done anything for me, and was really sweet in a way. I just don't know what went wrong and if I over reacted.