Did it move or was it very still? It looks like the case of a Dragonfly larva. They are aquatic until they hatch, at which time they climb out of the water and start breathing air. The skin splits from the back of the head and a Dragonfly emerges. The larva case is left behind looking much like the one you found.