The Crimean Khanate broke off from the Golden Horde in 1441. When the Horde came to an end in 1502 the buffer between Crimea and its northern neighbors disappeared. The Khans took advantage of the conflicts between Lithuania and Moscow, allying now with one, then with the other, and using the alliance with one as a justification to attack the other. During the Russo-Lithuanian War of 1500-1506 the Crimeans were allied with Russia and penetrated deep into Lithuania. Relations soon deteriorated. Near continuous raids on Muscovy began in 1507.. Which happened first, the Crimean Khanate breaking off from the Golden Horde or the Horde ending?