"free-for-all"

What is the origin of the phrase "free-for-all"

Originally, a "race or competition" (Webster's 2nd, unabridged) that anyone is free to enter. Later, a fight that everyone joins in.