In 784 H/1382 CE the Circassian Burji Mamluks elected al-Zahir Barquq to replace the last Bahri Mamluk Sultan al-Mansur Hajji II. Barquq’s first reign was a time of conflict in which he faced the opposition of rebellious Mamluk amirs who routed his army and finally deposed him. Hajji was reinstated, while Barquq was interned in the fortress of Karak. However, he had a good deal of support and within a year he was able to raise new forces and overthrow his opponents. Hajji lost the throne once again, being replaced by Barquq, which brought an end to the long line of Qala‘unid Bahri Mamluks who had reigned for over a century. For the first two years of Barquq’s second reign rebellions continued, but then a far greater danger threatened Egypt with the expected advance of Timur (known in the west as Tamerlaine, Timur the Lame). Barquq hastily gathered his own army and joined with those of the princes of Asia Minor to withstand this new enemy, but, in the event, the dreaded invasion failed to materialise. Barquq died in 801 H/1399 CE after nine years of just and benevolent rule. During his reign the Burji Mamluk coinage remained the same as that of the Bahris, and mints were maintained in both Egypt and Syria. Those of Egypt, Cairo and Alexandria mainly issued gold and copper, while those of Syria, Halab and Dimashq, struck more silver, with some gold and copper. The gold coinage had no fixed weight, which made the coins little more than stamped ingots that guaranteed the purity of the gold from which they were struck. Payments had always to be weighed and valued against the current price of silver, although this metal too had an unstable value, making transactions complex and acted as a hindrance to trade.