American Revolution
Southern colonies, fearing that armed slaves would lead to revolts, opposed the use of slaves in Patriot militia, though some would serve in isolated instances.
The British, however, recruited heavily in the South, promising freedom for any slave who fought for them with the Loyalists. Consequentially, while an estimated 9,000 black soldiers and sailors fought for the Americans, some 20,000 fought for the British.
***********************************
Post Revolution and War of 1812
After the American revolution, Blacks were pushed out of the U.S. military. The Federal Militia Acts of 1792, specifically prohibited black service in the U.S. Army.
As a result, few Blacks participated on the side of the United States during the War of 1812. Only Louisiana was allowed to have separate black militia units in that conflict.
Due to a severe manpower shortage, the U.S. Navy accepted free black recruits. Some 15% to 20% of Navy manpower was made up of them. Some slaves also served in the British Army and Navy in anticipation of freedom.