Happened with my 4 year old when she was at that age. What I did was to calm her down and ask why and what happened? Then I emphatize with her and offer solutions and alternatives. I always give her a hug and tell her if she needs to cry because she is upset, angry, it is ok to do so.
You can refer to this good read: http://www.positiveparentingconnection.net/when-your-child-says-i-hate-you/
Hope it helps and you will persevere. :)
Read more