The Short Answer
Many historians trace the first formal bar to the national militia law of 1792. That law limited militia service to free white men. The regular army’s rules and practice developed less neatly, so the answer depends on which force and which period you mean.
The 1792 Militia Act
Congress passed the Militia Act in 1792 to set out how the states would organize militias for national defense. The law limited militia duty to free, able-bodied white male citizens. Historians often treat this as the clearest early national exclusion of Black men from military service, although it governed the militia rather than the regular army.
Enlistment in the Regular Army
The regular army was a separate force from the militia, and its enlistment rules came from Congress and from army officers. Those rules were not always applied the same way. Some Black men did enlist in army units during the War of 1812, and the practice shifted in the decades that followed. The record is uneven, so it is safer to describe the pattern than to state a single rule.
Why the Rules Were Not Applied Evenly
Enforcement depended on local officers and on the needs of the moment. During wartime, commanders sometimes needed more men and accepted recruits they might otherwise have turned away. Over the following decades, exclusion became more fixed in practice, and the army’s policy grew more restrictive. The exact timing differed by region.
Black Service Despite the Restrictions
Black men still served, especially in the navy and in state and local militias. For the wider picture of how Black Americans fought in the war, the broader story of African American service in the War of 1812 covers the navy, the militia at New Orleans and the British offers of freedom to enslaved people.
What the Record Does and Does Not Show
Records from this period are incomplete. Many enlistments were not written down clearly, and some men appear only by first name or in a short note. Because of this, precise counts of Black soldiers and sailors are hard to confirm, and claims about exact numbers should be read with caution.