A loop invariant is a statement that holds true just before and after each iteration. It may be violated within the iteration, but the invariant must be restored by the end of the iteration.
It is useful in proving correctness of algorithms that utilize loops.