Hundreds of well-wishers gathered in the palace courtyard to greet the princess on her birthday, and they were treated to music from the army drum corps. The birthday girl was presented with bouquets by members of the public.
The birthday ceremony had been planned down to the finest detail, although some in the crowd added their own touch with spontaneous singing for the princess.
One of the visitors, Birgitta Bodin from Stockholm, risked a parking fine by leaving her car right outside the palace. She gave Madeleine an orchid.
"I was lucky to have been able to get to the front despite all the people. I called her name and was able to hand over the flower," she said.
After the public had given Princess Madeleine a traditional Swedish four cheers, the royal birthday girl walked around the crowd waving, before returning to the inside of the palace with the rest of the royal family.
"The rest of the celebrations will be private," said palace spokeswoman Nina Eldh.