"Chinese official," 1580s, via Portuguese mandarim or older Dutch mandorijn from Malay (Austronesian) mantri, from Hindi mantri "councilor, minister of state," from Sanskrit mantri, nominative of mantrin- "adviser," from mantra "counsel," from PIE root *men- (1) "to think."
Form influenced in Portuguese by mandar "to command, order." Used generically for the several grades of Chinese officials; sense of "chief dialect of Chinese" (spoken by officials and educated people) is from c. 1600. Transferred sense of "important person" attested by 1907. The type of small, deep-colored orange so called from 1771, from resemblance of its color to that of robes worn by mandarins.