1808, "that part of the Vedas which contains hymns," from Sanskrit mantra-s "sacred message or text, charm, spell, counsel," literally "instrument of thought," related to manyate "thinks," from PIE root *men- (1) "to think." Meaning "sacred text used as a charm or incantation" is by 1900; sense of "special word used for yoga meditation" is recorded in English by 1956.
1580s, "Chinese official," 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; the Chinese equivalent is kwan "public servant." Sense of "chief dialect of Chinese" (spoken by officials and educated people and generally in the northern, central, and western provinces and Manchuria) 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.