What is the origin of the phrase Fire in the hole?

The origin of the phrase "fire in the hole" is believed to be miners who set up a detonation charge and needed to warn other miners about it before they set it off. It could also have come from cannons, which have a hole in them filled with gunpowder that ignites when the fire reaches it.