Denmark's Prime Minister Mette Frederiksen was attacked in a public square in Copenhagen two days before elections.Photo by IDA MARIE ODGAARD/Ritzau Scanpix/AFP via Getty Images

Danish Prime Minister Mette Frederiksen was attacked Friday evening in a public square in Copenhagen's old town by a man who was quickly arrested.

Frederiksen suffered "minor whiplash" when the man gave her a hard shove, according to her office.

Two witnesses told the local newspaper BT: "A man came by in the opposite direction and gave her a hard shove on the shoulder, causing her to fall to the side."

Frederiksen did not, however, hit the ground, and sat at a nearby cafe to recover, they said.

It wasn't immediately clear if she required medical treatment.

Frederiksen, the leader of Denmark's largest party, the Social Democrats, had taken part earlier in an EU election event with her party's lead candidate, Christel Schaldemose.

The attack occurred just two days before two days before Danes head to the polls to vote in the European Union parliamentary elections.

European Commission chief Ursula von der Leyen called it a "despicable act, which goes against everything we believe in and fight for in Europe."

The Prime Minister is shocked by the incident," Frederiksen's office said in a statement.

Danish Minister of Environment Magnus Heunicke wrote in a post on X: "Mette is naturally shocked by the attack. I must say that it shakes all of us who are close to her."

Soren Kjergaard, a barista who works in the Kultorvet, the public square where the assault took place, told Reuters that Frederiksen appeared a "little stressed" after the incident..

What may have triggered the attack was not immediately known or revealed. Police are continuing to investigate.

The 39-year-old man arrested is scheduled due to appear at a hearing at the Frederiksberg Courthouse Saturday afternoon in connection with the incident.