Iud and discharge

I got the iud about a month ago and I kept taking the pill ask my doctor said finish the pack, I had no bleeding at all when I was on the pill and iud now I’ve stopped the pill and have continuous brown discharge what is this caused from and how long does it last?