Hurt by this "relationship"😢💔

I figured staying anonymous was best. I'm terrified of being judged. I just would like advice on this matter.

I have been in this long distance relationship with this guy since July 2014. We had this amazing connection and I absolutely fell in love and I believe that he did too. Every relationship has its ups and downs. We struggled with some things yet always found a way to talk about it and rise above it and move and be happy. We talked about meeting face to face and he was all for it. Skype was great but I wanted that physical connection too and so did he. Anyways he ended up falling really sick and had to have 3 surgeries. He had to pay for those surgeries and then of course had to take weeks off of work. I offered to come and see him and be with him because he had said he was bored and lonely (he has two school aged kids who spend half their time with their mom, his ex wife, and half their time with him). He told me no he wanted to come and see me first. I said ok that's fine no worries. I went on a missions trip for a month to help at an orphanage in kenya and when I got back home and was able to contact him he was different with me. Idk how to explain but a month after I was home, the night before my birthday he said we couldn't work as a couple and he needed space and that we should just be friends. I was upset. Then he had the nerve to continue talking to me as if we were together but then he'd say you're just a friend but he wanted to act like we were more than friends. He asked me if we would still meet some day and if I'd sleep with him. Then he got jealous when he found out some guy had an interest in me. I got mad because he dumped me and claimed to not want me yet still wanted control in my life and was threatened by other guys. I care about him as a friend but as nothing more than a friend. I'm okay with being friends but he's so up and down with me I think I should cut my ties to him? I'm just scared I guess. Because I truly loved this man and he kicked me to the curb without warning. Advice??