The lyrics come from a poem by Cecil Spring-Rice that he wrote in 1908 when he was working at the British Embassy in Stockholm , Sweden . The origin of the lyrics is a poem by diplomat Cecil Spring-Rice which he wrote in 1908 whilst posted to the British Embassy in Stockholm .