barbarian (n.)

early 15c., in reference to classical history, "a non-Roman or non-Greek," earlier barbar (late 14c.) "non-Roman or non-Greek person; non-Christian; person speaking a language different from one's own," from Medieval Latin barbarinus (source of Old French barbarin "Berber, pagan, Saracen, barbarian"), from Latin barbarus "strange, foreign, barbarous," from Greek barbaros "foreign, strange; ignorant," from PIE root *barbar- echoic of unintelligible speech of foreigners (compare Sanskrit barbara- "stammering," also "non-Aryan," Latin balbus "stammering," Czech blblati "to stammer").

Greek barbaroi (plural noun) meant "all that are not Greek," but especially the Medes and Persians; originally it was not entirely pejorative, but its sense became moreso after the Persian wars. The Romans (technically themselves barbaroi) took up the word and applied it to tribes or nations which had no Greek or Roman accomplishments.

Also in Middle English (c. 1400) "native of the Barbary coast;" meaning "rude, wild person" is from 1610s. Occasionally in 19c. English distinguished from savage (n.) as being a step closer to civilization. Sometimes, in reference to Renaissance Italy, "a non-Italian." It also was used to translate the usual Chinese word of contempt for foreigners.