A mandarin was a bureaucrat scholar in the government of imperial China, Korea and Vietnam. The English term comes from the Portuguese "mandarim". The Portuguese word was used in one of the earliest Portuguese reports about China. The Portuguese word was thought by many to be related to mandador ("one who commands") and mandar ("to command").

In the 16th century, before the term mandarin became widespread in the European languages, the word "Loutea" (with various spelling variations) was often used in Europeans' travel reports to refer to Chinese scholar-officials.

More Info: en.wikipedia.org