From the early minstrels. Around 1890, there began a spate of 'coon' songs where the people in question were black, later these shows became the black and white minstrel shows.
The American musical has one shameful chapter in its history – minstrel shows. The most popular musical stage shows of the early and mid 19th Century, minstrelsy embodied racial hatred. Both white and black performers donned blackface, and audiences of all colors loved it. Hateful as their content was, minstrel shows were the first form of musical theatre that was 100% American-born and bred.
Minstrel shows developed in the 1840’s, peaked after the Civil War and remained popular into the early 1900s. Minstrelsy was a product of its time, the only entertainment form born out of blind bigotry. In these shows, white men blackened their faces with burnt cork to lampoon Negroes, performing songs and skits that sentimentalized the nightmare of slave life on Southern plantations. Blacks were shown as naive buffoons who sang and danced the days away, gobbling "chitlins," stealing the occasional watermelon, and expressing their inexplicable love for "ol' massuh."
http://www.musicals101.com/minstrel.htm
In the minstrel show white entertainers put on blackface and "imitated" or "caricatured" slaves in the South and ex-slaves in the North. The distinction is crucial. During Mark Twain's time most white commentary on minstrelsy (including Twain's own remarks for his autobiography) assume its accuracy, its essentially faithful imitation of African-American speech, singing and dancing. Since the Civil Rights Movement, on the other hand, nearly every commentator agrees that the minstrel show "coon" is a racist caricature.
http://etext.virginia.edu/railton/huckfinn/minstrl.html
[Added references, the first does not mention the term 'coon.' - McG]