Military mining, undermining or tunnel warfare is a siege method based on mining techniques which has been used since antiquity against a walled city, fortress, castle or other strongly held and fortified military position. A counter mine is a mine dug to allow defenders to attack miners, or destroy a mine threatening their fortifications.
The Greek historian Polybius, in his Histories, gives a graphic account of mining and counter mining at the Roman siege of Ambracia:
The Aetolians [...] offered a gallant resistance to the assault of the siege artillery and [the Romans], therefore, in despair had recourse to mines and underground tunnels. Having safely secured the central one of their three works, and carefully concealed the shaft with wattle screens, they erected in front of it a covered walk or stoa about two hundred feet long, parallel with the wall; and beginning digging from that, they carried it on unceasingly day and night, working in relays. For a considerable number of days the besieged did not discover them carrying the earth away through the shaft; but when the heap of earth thus brought out became too high to be concealed from those inside the city, the commanders of the besieged garrison set to work vigorously digging a trench inside, parallel to the wall and to the stoa which faced the towers. When the trench was made to the required depth, they next placed in a row along the side of the trench nearest the wall a number of brazen vessels made very thin; and, as they walked along the bottom of the trench past these, they listened for the noise of the digging outside. Having marked the spot indicated by any of these brazen vessels, which were extraordinarily sensitive and vibrated to the sound outside, they began digging from within, at right angles to the trench, another underground tunnel leading under the wall, so calculated as to exactly hit the enemy's tunnel. This was soon accomplished, for the Romans had not only brought their mine up to the wall, but had under-pinned a considerable length of it on either side of their mine; and thus the two parties found themselves face to face.
The Aetolians then countered the Roman mine with smoke from burning feathers with charcoal.