The Seljuks were one of the first migrating Turkish groups that grew in strength and captured Baghdad from the Persians. After taking Baghdad, the Seljuk rulers gained the loyalty of their new Persian subjects by favorably treating them and appointing Persians to government positions.