I have designed and implemented a multi-agent simulation of military units to analyze the reason for the Ottoman defeat at the hands of Tamerlane’s army in the Battle of Ankara, 1402. Although historians largely agree on the general battle procedure, the details are still open to dispute. Several factors may have contributed to the defeat, such as the overwhelming size of Tamerlane’s army, poisoned water, the tactical formations of the military units, and betrayal by the Tartar cavalry in the Ottoman left wing. The approach is divided into two stages: the simulation stage, which provides data to analyze the complex interactions of autonomous agents, and the analysis stage, which uses data mining to examine the battle outcomes. The simulation is built on a finite state machine to evaluate the current situation of each agent and then choose the most appropriate action. To achieve historical accuracy, the simulation takes into account the topography of the battlefield, line-of-sight issues, period-specific combat tactics, and the armor and weapons used by the various military units at that time. The analysis stage evaluates the association strength between the battle outcome and the various factors that historians consider crucial to the outcome. The result shows that the overwhelming size of Tamerlane’s forces and betrayal by the Tartar cavalry were probably the most important factors. Increasing the number of Ottoman soldiers by 40,500 raises the chance of Ottoman victory from 0 to 10%, while an increase of 54,000 soldiers boosts the probability to 90%. Nevertheless, if the Tartar cavalry betrays their Ottoman allies, the chance of an Ottoman victory falls back to zero.