A crowd of several hundred people joined the 130 guardsmen at the zoo. A citation from King Harald the Fifth of Norway was read out, which described Nils as a penguin "in every way qualified to receive the honour and dignity of knighthood".
The guardsmen come to see Nils every few years while they are in Edinburgh performing at the city's Military Tattoo.
The proud penguin was on his best behaviour throughout most of the ceremony, but shortly before the ritual was concluded and possibly suffering a bout of nerves he was seen to deposit a discreet white puddle on the ground.