Ett gammalt fult och elakt troll det var en gång

"Ett gammalt fult och elakt troll det var en gång" known also for the shorter title "Det var en gång" (meaning "Once upon a time") is a traditional Swedish children's song, with music and lyrics by Felix Körling. Using references to several geographical locations, the song lyrics describe a troll, his wife and cat arriving to Sweden in a hot air balloon.

The song was first published in the collection Misse-Måns och andra visor in 1918.

An early recording of the song was made by Märta Ekström, with Otto Nordlund accompanying on the piano was performed on December 16, 1929, and released on a single in December 1930, entitled "Det var en gång" alongside the song "Precis som i sagan" again composed by Felix Körling.

More recently, the song was recorded by Peter Himmelstrand and released in 1978.

Ingeborg (Immi) Hellén wrote lyrics in Finnish, with the title "Oli kerran vanha peikko". The lyrics in Finnish use different geographical locations.