Second Battalion of the IX Coast Artillery Corps demonstrating the hollow square formation used in the event of a street riot, March, 1918. Machine gunners in front row and troopers with rifles behind them control the street, with ranks on the sides of the square covering windows and roofs of nearby buildings. An infantry square is a combat formation an infantry unit forms in close order when threatened with cavalry attack. Attacking cavalry would attempt to break a square by causing it to lose its cohesion, either by charging to induce poorly disciplined infantry to flee before making contact, or by causing casualties through close-range combat. The square fell out of use with the advent of modern repeating firearms and the decline of horse cavalry.