@dega2010- You are correct. El Cuco originated in Galicia and Portugal. Some people refer to it as “El Coco”. In the Portuguese language, “coco” refers to a pumpkin head ghost.
The legend is that, many years ago, people would make a lantern out of a carved vegetable, usually a pumpkin. They would carve out a mouth and two eyes and put a light inside of it to scare people away. It is very similar to what we know as a Jack o’ lantern.
This legend has been widely used in Latin America to “encourage” children to go to sleep. Children are led to believe that if they don’t go to sleep, the Cuco will come and take them away.