I remember from the days of Minecraft before its single player mode became a server + client running in the background. When you get within a Creeper's trigger radius, it begins to swell and make it's telltale warning sound. If you could get out of that radius before it blew up, it would shrink back down and not blow up.
I believe this mechanic is still in Minecraft, but because of latency and lag it tends to not work. That is, the server tells the client that the creeper is going to blow up rather than the client telling the server. Thus if the player moves out of the trigger radius but it takes too long for the server to get that message, the creeper will still blow up.
In your case, what probably happened was that you got far enough away fast enough that the server got the message before the Creeper detonated.