During the years 1747–1831, Iraq was ruled by a Mamluk dynasty of Georgian origin who succeeded in obtaining autonomy from the Ottoman Porte, suppressed tribal revolts, curbed the power of the Janissaries, restored order and introduced a programme of modernisation of economy and military. In 1831, the Ottomans managed to overthrow the Mamluk regime and imposed their direct control over Iraq. The population of Iraq, estimated at 30 million in 800 AD, was only 5 million at the start of the 20th century.