In China, an empire was established under the Tang dynasty, which remained in power for about 300 years (from the seventh to the tenth centuries). Its capital, Xi’an, was one of the largest cities in the world, visited by Turks, Iranians, Indians, Japanese and Koreans. The Tang empire was administered by a bureaucracy recruited through an examination, which was open to all who wished to appear for it. This system of selecting officials remained in place, with some changes, till 1911.