The Royal Danish Lifeguard was formed in 1658 by King Fredrik 3. At that time the King found it necessary to form a regiment which was separated from the army. At that time it was the only regiment which recruited only Danes and the King thereby got a regiment only faithful to him. Since then The Royal Danish Guard has protected the royal family.
Source: denmark.dk