Each time police officers draw their weapons, they step out of everyday law enforcement and into a rigidly defined world where written rules, hours of training and Supreme Court decisions dictate not merely when a gun can be fired, but where it is aimed, how many rounds should be squeezed off and when the shooting should stop.

The Ferguson, Mo., police officer who fatally shot an unarmed African-American teenager two weeks ago, setting off protest and riots, was bound by 12 pages of police department regulations, known as General Order 410.00, that govern officers’ use of force. Whether he followed them will play a central role in deliberations by a St. Louis County grand jury over whether the officer, Darren Wilson, should be charged with a crime in the shooting.

But as sweeping as restrictions on the use of weapons may be, deciding whether an officer acted correctly in firing at a suspect is not cut and dried. A host of outside factors, from the officer’s perception of a threat to the suspect’s behavior and even his size, can emerge as mitigating or damning.

The police, the courts and experts say some leeway is necessary in situations where officers under crushing stress must make split-second decisions with life-or-death consequences. A large majority of officers never use their weapons. A handful of officers may be rogue killers, researchers say, but laboratory simulations of armed confrontations show that many more officers — much like ordinary civilians — can make honest mistakes in the pressure cooker of an armed encounter.