The Oghuz Turks invaded Rhages in 1035 and again in 1042, but the city was recovered under the Seljuks and the Khwarezmians. Medieval writer Najm od Din Razi declared the population of Rhages about 500,000 before the Mongol invasion. In the 13th century, the Mongols invaded Rhages, laid the city to ruins, and massacred many of its inhabitants. Others escaped to Tehran.