Beaner is a derogatory slang term that refers to Mexicans, used in reference to people of Hispanic ancestry.  The term originates from the prevalence of pinto beans and other beans in Mexican cuisine.
According to The Historical Dictionary of American Slang, the word was first seen in print in 1965, although the term has reportedly been in use at least since the 1940s (perhaps having evolved from previous slurs such as "bean-eater" and "bean-bandit" that were in use since as far back as the 1910s.)
It appears that the term may be going through a phase of melioration, where the negative connotation of an ethnic slur is "reclaimed" by those against whom it is directed and used in a neutral or even positive manner.
- Booth, William (September 28, 2005). "The Mouth of Mencia". The Washington Post. Retrieved April 26, 2010.
- "San Diego's top Latino cop retires". The San Diego Union-Tribune. September 1, 2005.
- "Pedro deflects the barbs; Racist comments don't faze Sox ace". The Boston Herald. September 14, 2000.
- "You are what you eat... arguably: John Sutherland on national nicknames". The Guardian (UK). July 31, 2000.