Göran Hägglund was hit with the cake at 5pm at Kungsportsplatsen in Gothenburg.
"A man has been apprehended for disturbing the peace," Västra Götaland police spokesman Peter Adlersson stated. The police are building a case for harassment against the man, who is in his twenties.
The party's vice leader, David Lega, has informed media that the man was wearing a Christian Democrats jacket and had "infiltrated" the party. Shortly after the incident, an LGBT rights group called Fag Army took credit for the attack.
Hägglund's press secretary Johan Ingerö declined to comment on the incident.
The attack was not the first of its kind. Last year Sweden Democrat leader Jimme Åkesson was ambushed in a cake attack at a book signing. She was later convicted of harassment.