it can be many things, however I would take a test to rule out pregnancy. I know when I was using the pill I would have break through spotting.
Since you had your periods after the episode, so it nils the chances of pregnancy because if pregnancy occurs, menstrual periods cease. This spotting that occurs if due to the hormonal effect of the pills. Even stress and anxiety can also cause this.
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your doctor. I sincerely hope that helps. Take care and please do keep me posted on how you are doing.