Right, your update makes it just worse.
You really need to talk to your daughter - over time (weeks, not hours) - about abuse, abusive relationships, boundaries, red flags and walking away from people who harm you.
You need to listen a lot - but perhaps also share learning experiences from your life.
This is an incident that has antecedents - you don't get to that point in a 'friendship' without build-up.
She really needs to be in a place where she walks away from nutters, rather than builds deeper relationships with them and ends up harming herself/allowing them to harm her.
I guess you'll have to approach it as a 'learning experience' because she will be feeling shame and shame causes people to dig in.
The last thing you need is to have her clung more to this 'friend'.
(I would also suggest the wider friendship group is problematic since they enable the girl.)