Bleeding while sexually aroused

Last night when I was masturbating blood came out instead of the normal lubricating discharge. My period ended 3 days ago and it was 13 days long. I haven't bleed at all until I had masturbated and then the bleeding stopped a little while after. But it happened again today when I was with my boyfriend. Anyone have any ideas why this is happening?