It was commissioned by Filippo Cesarini in 1675 to Carlo Fontana, a student and collaborator of Gian Lorenzo Bernini, and is thought to have inspired the cliff in the Fountain of the Rivers  (Fontana dei Fiumi) in Piazza Navona.

Originally, the Fountain of Rocks showed two huge snakes, carved on both sides, that recalled the ancient cave of the snake linked to the cult of Juno Sospita, the ancient temple that has distinguished the history of Lanuvio.