When Philadelphia was occupied by the British during the American Revolutionary War, British units were housed in Germantown. In the Battle of Germantown, on October 4, 1777, the Continental Army attacked the garrison. During the battle, a group of civilians fired on the British troops as they marched up the avenue, mortally wounding British officer James Agnew. The Americans withdrew after firing on one another in the confusion of the battle, which resulted in the battle becoming a British victory. The American losses amounted to 673 men and the British losses consisted of 575 men, but along with the American victory at Saratoga on October 17 when John Burgoyne surrendered, the battle led to the official recognition of the Americans by France, which formed an alliance with the Americans afterward.