Victory at the Battle of Lake Erie on 10 September 1813 meant that the US controlled the lake. The British could not resupply Fort Amherstsburg at the mouth of the River Detroit or defend it, as most of its guns had been transferred to warships that were lost in the Battle of Lake Erie.
The garrison commander, General Henry Procter, therefore had the fort dismantled before starting to retreat along the River Thames on 27 September. Tecumseh, the leader of the Confederacy of Native American tribes that were allied to Britain, protested because this meant that the western tribes would be cut off from British support.
Most of the 4,000 Native Americans who had joined the British refused to retreat, but Tecumseh reluctantly withdrew with Procter, who had promised that he would make a stand. [1] Procter kept falling back, despite Tecumseh’s urging to stand and fight, The retreating British were pursued by US troops, commanded by General William Harrison. Lack of supplies and poor leadership by Procter meant that many British troops were lost during the retreat.
Procter eventually made a stand on 5 October on the Thames near Moraviantown, a community of Native Americans who had converted to Christianity, and modern-day Chatham. The subsequent battle is known as both the Battle of the Thames and the Battle of Moraviantown.

The Battle of the Thames
Source: http://en.wikipedia.org/wiki/File:Battle-of-the-Thames-array.jpg
Harrison had about 3,500 troops facing 6-700 British regulars and 1,000 Native Americans. Procter had made no attempt to fortify his position, and a charge by Kentucky mounted riflemen quickly broke through the British line, before taking Tecumseh’s tribesmen in the flank.
Tecumseh was amongst the dead. The Native American Confederacy died with him, and the tribal alliance with Britain ended. Procter was court-martialled for his conduct of the retreat and sentenced to six months loss of rank and pay. This was reduced to a reprimand on review, but this was still enough to end his career. The Battle of the Thames (or Moraviantown) was a resounding US victory that finished the war in the north-west and set Harrison on the path to the Presidency.
[1] Troop numbers are from T. Roosevelt, The Naval War of 1812, 2 vols. (New York, NY: Charles Scribner’s Sons, 1900-2). vol. i. pp. xiii-xiv.