Does anybody know?

This has been happening for a while and it only occurs at the end of my periods. I get like a brown discharge and before that instead of blood I get brown stuff that is the same density as blood. But in the begining it always starts out as a normal period. Does any one know what this means or what I should do?