The Tang dynasty was one of the most cosmopolitan in Chinese history. The princes as a hostage and students, including monks from foreign countries came to China. The three most important kinds of visitors were the envoys, clerics, students except merchants. They stayed as the palace guard and studied Chinese culture at school according to the educational system and organizations.
Foreign students consisted of diplomatics, clerics, students, foreign envoy, guest. Tang government offered free tuition, assisted their living allowance, provided free for clothing expenses, medical expenses and funeral costs, assisted to return to their countries.
The political rights were granted to the foreign students. After passing the national examination, the successful candidates went into government service, participated in national ceremonies, and registered census registration.
Foreign students exercised their own rights of civil affairs and assumed the legislative duties. They were not allowed wearing Chinese clothes, and could marry with Chinese women, but placed strict restrictions, and not permitted to do business.