The song was written in 1984 by Compay Segundo, who first "dreamt" the opening melody in his sleep and later wrote the lyrics. On the composition of the song, Compay Segundo said:
“I didn't compose Chan Chan, I dreamt it. I dream of music. I sometimes wake up with a melody in my head, I hear the instruments, all very clear. I look over the balcony and I see nobody, but I hear it as if it was played on the street. I don't know what it can be. One day I woke up hearing those four sensitive notes, I gave them a lyric inspired by a children's tale from my childhood, Juanica y Chan Chan, and you see, now it's sung everywhere.”