The Paris prosecutor's office said Monday that the 36-year-old man was detained following Sunday's incident and sent to a police psychiatric unit. An investigation has been opened into the damage of cultural artifacts.
Videos posted on social media showed a young man in a wig and lipstick who had arrived in a wheelchair. The man, whose identity was unknown, was also seen throwing roses in the museum gallery to slack-jawed guests.
The cake attack left a conspicuous white creamy smear on the glass but the famous work by Leonardo da Vinci wasn't damaged.
Security guards were filmed escorting the wig-wearing man away as he called out to the surprised visitors in the gallery: "Think of the Earth! There are people who are destroying the Earth! Think about it. Artists tell you: think of the Earth. That's why I did this."
Guards were then filmed cleaning the cake from the glass. A Louvre statement confirmed the attack on the artwork involving a "patisserie."
The 16th-century Renaissance masterpiece has seen a lot in its over-500 years in existence.
The painting was stolen in 1911 by a museum employee, an event which increased the painting's international fame. It was also damaged in an acid attack perpetrated by a vandal in the 1950s, and has since been kept behind glass.
In 2009, a Russian woman who was angry at not being able to get French citizenship threw a ceramic cup at it, smashing the cup but not harming the glass or the painting.