 In 1239, the Alania capital of Maghas was destroyed and Alan confederacy of the Northern Caucasian highlanders, nations, and tribes by Batu Khan (a Mongol leader and a grandson of Genghis Khan) "Magas was destroyed in the beginning of 1239 by the hordes of Batu Khan.Historically Magas was located at approximately the same place on which the new capital of Ingushetia is now built" – D.V.Zayats

In 1300–1400, there was frequent warfare between the Alans, Tamerlan, Tokhtamysh, culminating in the Battle of the Terek River.The Alan tribes built fortresses, castles, and defensive walls protecting the mountains from the invaders.