The maximum distance a bullet can travel after being fired depends on many variables, such as the type of gun, wind speed, weather, and aiming angle. Generally, the optimal angle for achieving long-distance shots is 30 degrees from horizontal.
Handguns like the 9mm can fire a bullet up to 1.2 miles (2130 yards), while rifles like the AR-15 — which are better suited to long-distance shots — can have a maximum range of up to 2.2 miles (3840 yards). However, maximum range is far from effective range, so the chances of hitting a target that far is slim.
In fact, the greatest distance at which a gun has been used effectively is just over 2.2 miles, or 3870 yards. A Canadian special forces sniper made this shot in Iraq in 2017, killing an Islamic State militant.