Before the foundation of the Empire in 1871, it had been the royal anthem of Prussia since 1795 and remained it after 1871. The melody of the hymn derived from the British anthem "God Save the King". For these reasons, the song failed to become popular within all of Germany. Not only did it fail to win the support of most German nationalists, it was never recognized by the southern German states, such as Bavaria or Württemberg. After World War I, the German Empire came to an end and "Das Lied der Deutschen" became the national anthem of the Weimar Republic.