The lyrics were written by Bjørnstjerne Bjørnson between 1859 and 1868 , and the melody was written by his cousin Rikard Nordraak sometime during the winter of 1863-1864 .
The lyrics were written by Bjørnstjerne Bjørnson , and melody by his cousin , Rikard Nordraak .