Oh my gosh - I wrote a long reply and the internet ate it.
Yes, I've been there - it was a very long time ago, but I haven't forgotten the pain of it. I agree that it is excruciating, it is hell.
I stayed friends in my situation, too, and it turned out to prolong the pain. Later on, I looked back and wished that I had had the strength to cut off contact with the person. I had a bad episode of depression afterwards and pretty much lost the ability to have any kind of relationship for 3-4 years during a time of my life when I would have liked to be looking for someone for a long-term relationship.
I think people who are prone to have serious depressive episodes do well to be careful emotionally. I know that sounds "chicken", but I'm basing it on painful experience. I used to be somewhat of an emotional risk-taker, someone who really loved the adrenalin rush that comes from risky relationships, but it was very destructive.