not my boyfriends baby, how do I tell him?

Well, so I've just found out I'm 17 weeks pregnant and my boyfriend doesn't know yet, but how do I tell him that the baby isn't his(I didn't cheat on him, we haven't Been together long enough for this to be his baby) the thing is he's told me he doesn't want children for at least another 5 years and I really like him, like almost love him but not quite. He's the first guy I've ever been with that I've imagined to actually have a future with. I'm so scared he'll leave me. How do I break it to him nicely?