The film came together when Guillermo del Toro bumped into Pedro Almodóvar at the 1994 Miami Film Festival where he had just shown Cronos (1993). Almodovar told him that he had just seen his film and wanted to produce his next movie.
The Spanish comic series "Paracuellos" by Carlos Giménez was an important source of inspiration. This semi-biographical work takes place in a Francoist orphanage during the early 50's. Giménez worked as a storyboard artist on this film.
Guillermo del Toro has said of the characters in this film: "All the good guys in the film had the initials 'C' and I wanted to have Jacinto and Jaime to share the same initial because Jaime is a bully that chooses to change--unlike his grown up counterpart."
The trivia items below may give away important plot points.
The reason for Andreas Muñoz also being credited (alongside Junio Valverde) as Santi is because Muñoz replaced Valverde in part of the underwater scenes after Valverde had to go to the hospital for a barotrauma caused by the water pressure on his ears.
On the first day of Andreas Muñoz shooting in the ghost Santi makeup, director Guillermo del Toro asked him to do all of Santi's movements backwards so that del Toro could then play them forward in the final film to produce an eerie feeling, but after del Toro assessed that this would take too long in shooting time, Muñoz then performed the remaining ghost Santi scenes normally.