Miscarriage... or?

Henriette
Husband and I have not been using protection, but also not really trying to get pregnant. This time when I got my period (exactly on time), it was incredibly painful (doubled over in pain for 2 days) and there were pieces of something bloody and thick, in the blood. Could this have been a miscarriage or some kind of weird uterine wall shedding? Anyone experience this before? During the next 4 days of period it was just brown spotting.