 At the end of the 9th century, the area was settled by the Hungarians and was subsequently included into the medieval Kingdom of Hungary.In the 11th century, the territory of present-day Jászság was part of the Újvár County, while in the 12th century, it was divided between Hevesújvár and Pest counties.The Mongol invasions of the 13th century and Tamerlane's wars in the 14th century proved fatal to the Alan state and a group of Alans migrated with the Qipchaqs (Comani, Cumans) into Central Europe, settling in the medieval Kingdom of Hungary in the 13th century.