Storing dirty diapers

What's the best method to store dirty diapers? Can I just use a 5 gallon pail with a lid?