How early can you miscarry?

I heard that it can happen before implantation.  Is this true?