Historically inhabited by the Indo-Iranians, the written history of Turkmenistan begins with its annexation by the Achaemenid Empire of Ancient Iran. Later, in the 8th century AD, Turkic-speaking Oghuz tribes moved from Mongolia into present-day Central Asia. Part of a powerful confederation of tribes, these Oghuz formed the ethnic basis of the modern Turkmen population. In the 10th century, the name "Turkmen" was first applied to Oghuz groups that accepted Islam and began to occupy present-day Turkmenistan. There they were under the dominion of the Seljuk Empire, which was composed of Oghuz groups living in present-day Iran and Turkmenistan. Oghuz groups in the service of the empire played an important role in the spreading of Turkic culture when they migrated westward into present-day Azerbaijan and eastern Turkey.