During Vasily II 's reign the Golden Horde collapsed and broke up into smaller Khanates. Now that his throne was relatively secure, he had to deal with the Tatar threat. In 1439, Vasily II had to flee the capital, when it was besieged by Ulugh Muhammad, ruler of the nascent Kazan Khanate. Six years later, he personally led his troops against Ulugh Muhammad, but was defeated and taken prisoner. The Russians were forced to gather an enormous ransom for their prince, so that Vasily II could be released some five months later.