i messed up big time...

I am currently in a relationship with this wonderful man and we just started a few days ago. In the course of this going on, my now ex (with whom I was in a "break" with for a year), was told only yesterday that I wanted to completely cut ties with him. So I blocked him from everything and gave him his stuff back. Today I was planning to hangout with good friends of mine who had just had a beautiful baby girl two months ago and I was due a visit. This was supposed to be a day of just hanging out and having fun but then my ex showed up unexpectedly and made me feel vulnerable. We ended up talking and the talking lead to sex. I feel so guilty about it because I just got into another relationship and I don't want to jeopardize what we have going on already but I feel like I already did. I want to tell him the truth before my ex does especially since now he wants to use that as blackmail. I need some strength right now because I feel dirty.