On July 17, 1917, King George V changed the royal surname to "Windsor." Traditionally, the Royals didn't have a surname, and they took the name of their House, or dynastic name, from the male line. Queen Victoria — of the House of Hanover — had married Prince Albert of Saxe-Coburg and Gotha, a German prince; their successors then bore the name of "Saxe-Coburg and Gotha."
But by 1917, three years into The Great War, anti-German sentiment was high and the royal family's close ties with Germany became a sore point. When German heavy aircraft called the "Gotha" began dropping bombs on London in March, Victoria and Albert's grandson, George V, made a royal proclamation, stating:
"We [...] do hereby declare [...] that as from the date [...] Our House and Family shall be [...] known as the House and Family of Windsor, and that all the descendants in the male line of Our said Grandmother Queen Victoria [...] shall bear the said Name of Windsor."
George V chose the name after Windsor Castle, which had been a royal residence for 800 years.
The German emperor, Kaiser Wilhelm II, was also Queen Victoria's grandson. He took the news of his cousin's name change in stride, joking that he was looking forward to seeing Shakespeare's play The Merry Wives of Saxe-Coburg-Gotha.