In 1397, Bayezid defeated the emir of Karaman in Akçay, killing him and annexing his territory.
In 1398, the sultan conquered the Djanik emirate and the territory of Burhan al-Din, violating the accord with the Turco-Mongol warlord Timur.
Finally, Bayezid occupied Elbistan and Malatya.

In 1400, Timur succeeded in rousing the local Turkic beyliks who had been vassals of the Ottomans to join him in his attack on Bayezid, who was also considered one of the most powerful rulers in the Muslim world during that period.
Years of insulting letters had passed between Timur and Bayezid.
Both rulers insulted each other in their own way while Timur preferred to undermine Bayezid's position as a ruler and play down the significance of his military successes.

This is the excerpt from one of Timur's letters addressed to Ottoman sultan:
"Believe me, you are but pismire ant: don't seek to fight the elephants for they'll crush you under their feet.
Shall a petty prince such as you are contend with us?
But your rodomontades (braggadocio) are not extraordinary; for a Turcoman never spake with judgement.
If you don't follow our counsels you will regret it".

In the fateful Battle of Ankara, on 20 July 1402, the Ottoman army was defeated.
Bayazid tried to escape, but was captured and taken to Timur.
Historians describe their first meeting as follows:
When Timur saw Bayezid, he laughed.
Bayezid, offended by this laugh, told Timur that it was indecent to laugh at misfortune; to which Timur replied: “It is clear then that fate does not value power and possession of vast lands if it distributes them to cripples: to you, the crooked, and to me, the lame.”

Many writers claim that Bayezid was mistreated by the Timurids.
However, writers and historians from Timur's own court reported that Bayezid was treated well, and that Timur even mourned his death.
One of Bayezid's sons, Mustafa Çelebi, was captured with him and held captive in Samarkand until 1405.

Four of Bayezid's sons, specifically Süleyman Çelebi, İsa Çelebi, Mehmed Çelebi, and Musa Çelebi, however, escaped from the battlefield and later started a civil war for the Ottoman throne known as the Ottoman Interregnum.
After Mehmed's victory, his coronation as Mehmed I, and the death of all four but Mehmed, Bayezid's other son Mustafa Çelebi emerged from hiding and began two failed rebellions against his brother Mehmed and, after Mehmed's death, his nephew Murat II.
In 1397, Bayezid defeated the emir of Karaman in Akçay, killing him and annexing his territory. In 1398, the sultan conquered the Djanik emirate and the territory of Burhan al-Din, violating the accord with the Turco-Mongol warlord Timur. Finally, Bayezid occupied Elbistan and Malatya.
In 1400, Timur succeeded in rousing the local Turkic beyliks who had been vassals of the Ottomans to join him in his attack on Bayezid, who was also considered one of the most powerful rulers in the Muslim world during that period. Years of insulting letters had passed between Timur and Bayezid. Both rulers insulted each other in their own way while Timur preferred to undermine Bayezid's position as a ruler and play down the significance of his military successes. 
This is the excerpt from one of Timur's letters addressed to Ottoman sultan:
"Believe me, you are but pismire ant: don't seek to fight the elephants for they'll crush you under their feet. Shall a petty prince such as you are contend with us? But your rodomontades (braggadocio) are not extraordinary; for a Turcoman never spake with judgement. If you don't follow our counsels you will regret it".
In the fateful Battle of Ankara, on 20 July 1402, the Ottoman army was defeated. Bayazid tried to escape, but was captured and taken to Timur. Historians describe their first meeting as follows:
When Timur saw Bayezid, he laughed. Bayezid, offended by this laugh, told Timur that it was indecent to laugh at misfortune; to which Timur replied: “It is clear then that fate does not value power and possession of vast lands if it distributes them to cripples: to you, the crooked, and to me, the lame.”
Many writers claim that Bayezid was mistreated by the Timurids. However, writers and historians from Timur's own court reported that Bayezid was treated well, and that Timur even mourned his death. One of Bayezid's sons, Mustafa Çelebi, was captured with him and held captive in Samarkand until 1405.
Four of Bayezid's sons, specifically Süleyman Çelebi, İsa Çelebi, Mehmed Çelebi, and Musa Çelebi, however, escaped from the battlefield and later started a civil war for the Ottoman throne known as the Ottoman Interregnum. After Mehmed's victory, his coronation as Mehmed I, and the death of all four but Mehmed, Bayezid's other son Mustafa Çelebi emerged from hiding and began two failed rebellions against his brother Mehmed and, after Mehmed's death, his nephew Murat II.
Bayezid I