In September and October 1777, two engagements near Saratoga, New York, ended British General John Burgoyne's campaign to seize the Hudson River Valley. At Freeman's Farm on September 19, American forces under General Horatio Gates inflicted significant casualties on the British. At Bemis Heights on October 7, a second British attack was repulsed. By October 13, approximately 20,000 American troops surrounded Burgoyne's remaining force. He surrendered 5,000 British and Hessian soldiers on October 17. France subsequently entered the war as an American ally.